diff --git a/Tests/Rivet/LHC/LHC-13-Jets-0.in b/Tests/Rivet/LHC/LHC-13-Jets-0.in
--- a/Tests/Rivet/LHC/LHC-13-Jets-0.in
+++ b/Tests/Rivet/LHC/LHC-13-Jets-0.in
@@ -1,12 +1,12 @@
 # -*- ThePEG-repository -*-
 # CMS Jets
 insert /Herwig/Analysis/RivetAnalysis:Analyses 0 CMS_2016_I1459051
 insert /Herwig/Analysis/RivetAnalysis:Analyses 0 ATLAS_2016_CONF_2016_092
 # ATLAS jets
 insert /Herwig/Analysis/RivetAnalysis:Analyses 0 ATLAS_2018_I1634970
 # CMS double parton
 insert /Herwig/Analysis/RivetAnalysis:Analyses 0 CMS_2021_I1932460
 # double differential jets
 insert /Herwig/Analysis/RivetAnalysis:Analyses 0 CMS_2021_I1972986
 # CMS jet substructure
-insert /Herwig/Analysis/RivetAnalysis:Analyses 0 CMS_2021_I1920187_DIJET
+insert /Herwig/Analysis/RivetAnalysis:Analyses 0 CMS_2021_I1920187:MODE=DIJET
diff --git a/Tests/Rivet/LHC/LHC-13-Jets-1.in b/Tests/Rivet/LHC/LHC-13-Jets-1.in
--- a/Tests/Rivet/LHC/LHC-13-Jets-1.in
+++ b/Tests/Rivet/LHC/LHC-13-Jets-1.in
@@ -1,15 +1,15 @@
 # -*- ThePEG-repository -*-
 # CMS Jets
 insert /Herwig/Analysis/RivetAnalysis:Analyses 0 CMS_2016_I1459051
 insert /Herwig/Analysis/RivetAnalysis:Analyses 0 ATLAS_2016_CONF_2016_092
 # ATLAS jets
 insert /Herwig/Analysis/RivetAnalysis:Analyses 0 ATLAS_2018_I1634970
 # CMS correlations
 insert /Herwig/Analysis/RivetAnalysis:Analyses 0 CMS_2018_I1643640
 insert /Herwig/Analysis/RivetAnalysis:Analyses 0 CMS_2019_I1719955
 # CMS double parton
 insert /Herwig/Analysis/RivetAnalysis:Analyses 0 CMS_2021_I1932460
 # double differential jets
 insert /Herwig/Analysis/RivetAnalysis:Analyses 0 CMS_2021_I1972986
 # CMS jet substructure
-insert /Herwig/Analysis/RivetAnalysis:Analyses 0 CMS_2021_I1920187_DIJET
\ No newline at end of file
+insert /Herwig/Analysis/RivetAnalysis:Analyses 0 CMS_2021_I1920187:MODE=DIJET
\ No newline at end of file
diff --git a/Tests/Rivet/LHC/LHC-13-Jets-10.in b/Tests/Rivet/LHC/LHC-13-Jets-10.in
--- a/Tests/Rivet/LHC/LHC-13-Jets-10.in
+++ b/Tests/Rivet/LHC/LHC-13-Jets-10.in
@@ -1,17 +1,17 @@
 # -*- ThePEG-repository -*-
 # CMS Jets
 insert /Herwig/Analysis/RivetAnalysis:Analyses 0 CMS_2016_I1459051
 insert /Herwig/Analysis/RivetAnalysis:Analyses 0 ATLAS_2016_CONF_2016_092
 # ATLAS jets
 insert /Herwig/Analysis/RivetAnalysis:Analyses 0 ATLAS_2018_I1634970
 # ATLAS Lund plane
 insert /Herwig/Analysis/RivetAnalysis:Analyses 0 ATLAS_2020_I1790256
 # ATLAS charged fragmentation
 insert /Herwig/Analysis/RivetAnalysis:Analyses 0 ATLAS_2019_I1740909
 # CMS correlations
 insert /Herwig/Analysis/RivetAnalysis:Analyses 0 CMS_2018_I1643640
 insert /Herwig/Analysis/RivetAnalysis:Analyses 0 CMS_2019_I1719955
 # double differential jets
 insert /Herwig/Analysis/RivetAnalysis:Analyses 0 CMS_2021_I1972986
 # CMS jet substructure
-insert /Herwig/Analysis/RivetAnalysis:Analyses 0 CMS_2021_I1920187_DIJET
\ No newline at end of file
+insert /Herwig/Analysis/RivetAnalysis:Analyses 0 CMS_2021_I1920187:MODE=DIJET
diff --git a/Tests/Rivet/LHC/LHC-13-Jets-2.in b/Tests/Rivet/LHC/LHC-13-Jets-2.in
--- a/Tests/Rivet/LHC/LHC-13-Jets-2.in
+++ b/Tests/Rivet/LHC/LHC-13-Jets-2.in
@@ -1,15 +1,15 @@
 # -*- ThePEG-repository -*-
 # CMS Jets
 insert /Herwig/Analysis/RivetAnalysis:Analyses 0 CMS_2016_I1459051
 insert /Herwig/Analysis/RivetAnalysis:Analyses 0 ATLAS_2016_CONF_2016_092
 # ATLAS jets
 insert /Herwig/Analysis/RivetAnalysis:Analyses 0 ATLAS_2018_I1634970
 # CMS correlations
 insert /Herwig/Analysis/RivetAnalysis:Analyses 0 CMS_2018_I1643640
 insert /Herwig/Analysis/RivetAnalysis:Analyses 0 CMS_2019_I1719955
 # CMS double parton
 insert /Herwig/Analysis/RivetAnalysis:Analyses 0 CMS_2021_I1932460
 # double differential jets
 insert /Herwig/Analysis/RivetAnalysis:Analyses 0 CMS_2021_I1972986
 # CMS jet substructure
-insert /Herwig/Analysis/RivetAnalysis:Analyses 0 CMS_2021_I1920187_DIJET
+insert /Herwig/Analysis/RivetAnalysis:Analyses 0 CMS_2021_I1920187:MODE=DIJET
diff --git a/Tests/Rivet/LHC/LHC-13-Jets-3.in b/Tests/Rivet/LHC/LHC-13-Jets-3.in
--- a/Tests/Rivet/LHC/LHC-13-Jets-3.in
+++ b/Tests/Rivet/LHC/LHC-13-Jets-3.in
@@ -1,17 +1,17 @@
 # -*- ThePEG-repository -*-
 # CMS Jets
 insert /Herwig/Analysis/RivetAnalysis:Analyses 0 CMS_2016_I1459051
 insert /Herwig/Analysis/RivetAnalysis:Analyses 0 ATLAS_2016_CONF_2016_092
 # ATLAS jets
 insert /Herwig/Analysis/RivetAnalysis:Analyses 0 ATLAS_2018_I1634970
 # ATLAS charged fragmentation
 insert /Herwig/Analysis/RivetAnalysis:Analyses 0 ATLAS_2019_I1740909
 # CMS correlations
 insert /Herwig/Analysis/RivetAnalysis:Analyses 0 CMS_2018_I1643640
 insert /Herwig/Analysis/RivetAnalysis:Analyses 0 CMS_2019_I1719955
 # CMS double parton
 insert /Herwig/Analysis/RivetAnalysis:Analyses 0 CMS_2021_I1932460
 # double differential jets
 insert /Herwig/Analysis/RivetAnalysis:Analyses 0 CMS_2021_I1972986
 # CMS jet substructure
-insert /Herwig/Analysis/RivetAnalysis:Analyses 0 CMS_2021_I1920187_DIJET
+insert /Herwig/Analysis/RivetAnalysis:Analyses 0 CMS_2021_I1920187:MODE=DIJET
diff --git a/Tests/Rivet/LHC/LHC-13-Jets-4.in b/Tests/Rivet/LHC/LHC-13-Jets-4.in
--- a/Tests/Rivet/LHC/LHC-13-Jets-4.in
+++ b/Tests/Rivet/LHC/LHC-13-Jets-4.in
@@ -1,18 +1,18 @@
 # -*- ThePEG-repository -*-
 # CMS Jets
 insert /Herwig/Analysis/RivetAnalysis:Analyses 0 CMS_2016_I1459051
 insert /Herwig/Analysis/RivetAnalysis:Analyses 0 ATLAS_2016_CONF_2016_092
 insert /Herwig/Analysis/RivetAnalysis:Analyses 0 CMS_2018_I1682495
 # ATLAS jets
 insert /Herwig/Analysis/RivetAnalysis:Analyses 0 ATLAS_2018_I1634970
 # ATLAS charged fragmentation
 insert /Herwig/Analysis/RivetAnalysis:Analyses 0 ATLAS_2019_I1740909
 # CMS correlations
 insert /Herwig/Analysis/RivetAnalysis:Analyses 0 CMS_2018_I1643640
 insert /Herwig/Analysis/RivetAnalysis:Analyses 0 CMS_2019_I1719955
 # CMS double parton
 insert /Herwig/Analysis/RivetAnalysis:Analyses 0 CMS_2021_I1932460
 # double differential jets
 insert /Herwig/Analysis/RivetAnalysis:Analyses 0 CMS_2021_I1972986
 # CMS jet substructure
-insert /Herwig/Analysis/RivetAnalysis:Analyses 0 CMS_2021_I1920187_DIJET
+insert /Herwig/Analysis/RivetAnalysis:Analyses 0 CMS_2021_I1920187:MODE=DIJET
diff --git a/Tests/Rivet/LHC/LHC-13-Jets-5.in b/Tests/Rivet/LHC/LHC-13-Jets-5.in
--- a/Tests/Rivet/LHC/LHC-13-Jets-5.in
+++ b/Tests/Rivet/LHC/LHC-13-Jets-5.in
@@ -1,18 +1,18 @@
 # -*- ThePEG-repository -*-
 # CMS Jets
 insert /Herwig/Analysis/RivetAnalysis:Analyses 0 CMS_2016_I1459051
 insert /Herwig/Analysis/RivetAnalysis:Analyses 0 ATLAS_2016_CONF_2016_092
 insert /Herwig/Analysis/RivetAnalysis:Analyses 0 CMS_2018_I1682495
 # ATLAS jets
 insert /Herwig/Analysis/RivetAnalysis:Analyses 0 ATLAS_2018_I1634970
 # ATLAS charged fragmentation
 insert /Herwig/Analysis/RivetAnalysis:Analyses 0 ATLAS_2019_I1740909
 # CMS correlations
 insert /Herwig/Analysis/RivetAnalysis:Analyses 0 CMS_2018_I1643640
 insert /Herwig/Analysis/RivetAnalysis:Analyses 0 CMS_2019_I1719955
 # CMS double parton
 insert /Herwig/Analysis/RivetAnalysis:Analyses 0 CMS_2021_I1932460
 # double differential jets
 insert /Herwig/Analysis/RivetAnalysis:Analyses 0 CMS_2021_I1972986
 # CMS jet substructure
-insert /Herwig/Analysis/RivetAnalysis:Analyses 0 CMS_2021_I1920187_DIJET
+insert /Herwig/Analysis/RivetAnalysis:Analyses 0 CMS_2021_I1920187:MODE=DIJET
diff --git a/Tests/Rivet/LHC/LHC-13-Jets-6.in b/Tests/Rivet/LHC/LHC-13-Jets-6.in
--- a/Tests/Rivet/LHC/LHC-13-Jets-6.in
+++ b/Tests/Rivet/LHC/LHC-13-Jets-6.in
@@ -1,20 +1,20 @@
 # -*- ThePEG-repository -*-
 # CMS Jets
 insert /Herwig/Analysis/RivetAnalysis:Analyses 0 CMS_2016_I1459051
 insert /Herwig/Analysis/RivetAnalysis:Analyses 0 ATLAS_2016_CONF_2016_092
 insert /Herwig/Analysis/RivetAnalysis:Analyses 0 CMS_2018_I1682495
 # ATLAS jets
 insert /Herwig/Analysis/RivetAnalysis:Analyses 0 ATLAS_2018_I1634970
 # ATLAS charged fragmentation
 insert /Herwig/Analysis/RivetAnalysis:Analyses 0 ATLAS_2019_I1740909
 # CMS correlations
 insert /Herwig/Analysis/RivetAnalysis:Analyses 0 CMS_2018_I1643640
 insert /Herwig/Analysis/RivetAnalysis:Analyses 0 CMS_2019_I1719955
 # ATLAS soft-drop
 insert /Herwig/Analysis/RivetAnalysis:Analyses 0 ATLAS_2019_I1772062
 # CMS double parton
 insert /Herwig/Analysis/RivetAnalysis:Analyses 0 CMS_2021_I1932460
 # double differential jets
 insert /Herwig/Analysis/RivetAnalysis:Analyses 0 CMS_2021_I1972986
 # CMS jet substructure
-insert /Herwig/Analysis/RivetAnalysis:Analyses 0 CMS_2021_I1920187_DIJET
+insert /Herwig/Analysis/RivetAnalysis:Analyses 0 CMS_2021_I1920187:MODE=DIJET
diff --git a/Tests/Rivet/LHC/LHC-13-Jets-7.in b/Tests/Rivet/LHC/LHC-13-Jets-7.in
--- a/Tests/Rivet/LHC/LHC-13-Jets-7.in
+++ b/Tests/Rivet/LHC/LHC-13-Jets-7.in
@@ -1,20 +1,20 @@
 # -*- ThePEG-repository -*-
 # CMS Jets
 insert /Herwig/Analysis/RivetAnalysis:Analyses 0 CMS_2016_I1459051
 insert /Herwig/Analysis/RivetAnalysis:Analyses 0 ATLAS_2016_CONF_2016_092
 insert /Herwig/Analysis/RivetAnalysis:Analyses 0 CMS_2018_I1682495
 insert /Herwig/Analysis/RivetAnalysis:Analyses 0 ATLAS_2018_I1711114
 # ATLAS jets
 insert /Herwig/Analysis/RivetAnalysis:Analyses 0 ATLAS_2018_I1634970
 insert /Herwig/Analysis/RivetAnalysis:Analyses 0 ATLAS_2019_I1724098
 # ATLAS charged fragmentation
 insert /Herwig/Analysis/RivetAnalysis:Analyses 0 ATLAS_2019_I1740909
 # CMS correlations
 insert /Herwig/Analysis/RivetAnalysis:Analyses 0 CMS_2018_I1643640
 insert /Herwig/Analysis/RivetAnalysis:Analyses 0 CMS_2019_I1719955
 # ATLAS event shapes
 insert /Herwig/Analysis/RivetAnalysis:Analyses 0 ATLAS_2020_I1808726
 # double differential jets
 insert /Herwig/Analysis/RivetAnalysis:Analyses 0 CMS_2021_I1972986
 # CMS jet substructure
-insert /Herwig/Analysis/RivetAnalysis:Analyses 0 CMS_2021_I1920187_DIJET
+insert /Herwig/Analysis/RivetAnalysis:Analyses 0 CMS_2021_I1920187:MODE=DIJET
diff --git a/Tests/Rivet/LHC/LHC-13-Jets-8.in b/Tests/Rivet/LHC/LHC-13-Jets-8.in
--- a/Tests/Rivet/LHC/LHC-13-Jets-8.in
+++ b/Tests/Rivet/LHC/LHC-13-Jets-8.in
@@ -1,22 +1,22 @@
 # -*- ThePEG-repository -*-
 # CMS Jets
 insert /Herwig/Analysis/RivetAnalysis:Analyses 0 CMS_2016_I1459051
 insert /Herwig/Analysis/RivetAnalysis:Analyses 0 ATLAS_2016_CONF_2016_092
 insert /Herwig/Analysis/RivetAnalysis:Analyses 0 CMS_2018_I1682495
 # ATLAS jets
 insert /Herwig/Analysis/RivetAnalysis:Analyses 0 ATLAS_2018_I1634970
 # ATLAS charged fragmentation
 insert /Herwig/Analysis/RivetAnalysis:Analyses 0 ATLAS_2019_I1740909
 # ATLAS soft-drop
 insert /Herwig/Analysis/RivetAnalysis:Analyses 0 ATLAS_2017_I1637587
 # ATLAS Lund plane
 insert /Herwig/Analysis/RivetAnalysis:Analyses 0 ATLAS_2020_I1790256
 # CMS correlations
 insert /Herwig/Analysis/RivetAnalysis:Analyses 0 CMS_2018_I1643640
 insert /Herwig/Analysis/RivetAnalysis:Analyses 0 CMS_2019_I1719955
 # ATLAS event shapes
 insert /Herwig/Analysis/RivetAnalysis:Analyses 0 ATLAS_2020_I1808726
 # double differential jets
 insert /Herwig/Analysis/RivetAnalysis:Analyses 0 CMS_2021_I1972986
 # CMS jet substructure
-insert /Herwig/Analysis/RivetAnalysis:Analyses 0 CMS_2021_I1920187_DIJET
+insert /Herwig/Analysis/RivetAnalysis:Analyses 0 CMS_2021_I1920187:MODE=DIJET
diff --git a/Tests/Rivet/LHC/LHC-13-Jets-9.in b/Tests/Rivet/LHC/LHC-13-Jets-9.in
--- a/Tests/Rivet/LHC/LHC-13-Jets-9.in
+++ b/Tests/Rivet/LHC/LHC-13-Jets-9.in
@@ -1,20 +1,20 @@
 # -*- ThePEG-repository -*-
 # CMS Jets
 insert /Herwig/Analysis/RivetAnalysis:Analyses 0 CMS_2016_I1459051
 insert /Herwig/Analysis/RivetAnalysis:Analyses 0 ATLAS_2016_CONF_2016_092
 insert /Herwig/Analysis/RivetAnalysis:Analyses 0 CMS_2018_I1682495
 # ATLAS jets
 insert /Herwig/Analysis/RivetAnalysis:Analyses 0 ATLAS_2018_I1634970
 # ATLAS Lund plane
 insert /Herwig/Analysis/RivetAnalysis:Analyses 0 ATLAS_2020_I1790256
 # ATLAS charged fragmentation
 insert /Herwig/Analysis/RivetAnalysis:Analyses 0 ATLAS_2019_I1740909
 # CMS correlations
 insert /Herwig/Analysis/RivetAnalysis:Analyses 0 CMS_2018_I1643640
 insert /Herwig/Analysis/RivetAnalysis:Analyses 0 CMS_2019_I1719955
 # ATLAS event shapes
 insert /Herwig/Analysis/RivetAnalysis:Analyses 0 ATLAS_2020_I1808726
 # double differential jets
 insert /Herwig/Analysis/RivetAnalysis:Analyses 0 CMS_2021_I1972986
 # CMS jet substructure
-insert /Herwig/Analysis/RivetAnalysis:Analyses 0 CMS_2021_I1920187_DIJET
+insert /Herwig/Analysis/RivetAnalysis:Analyses 0 CMS_2021_I1920187:MODE=DIJET
diff --git a/Tests/Rivet/LHC/LHC-13-Z-mu.in b/Tests/Rivet/LHC/LHC-13-Z-mu.in
--- a/Tests/Rivet/LHC/LHC-13-Z-mu.in
+++ b/Tests/Rivet/LHC/LHC-13-Z-mu.in
@@ -1,22 +1,22 @@
 # -*- ThePEG-repository -*-
 ##################################################
 # select the analyses
 ##################################################
 # ATLAS Z
 insert /Herwig/Analysis/RivetAnalysis:Analyses 0 ATLAS_2015_CONF_2015_041_MU
 insert /Herwig/Analysis/RivetAnalysis:Analyses 0 ATLAS_2019_I1768911:LMODE=MU
 # ATLAS Z UE
 insert /Herwig/Analysis/RivetAnalysis:Analyses 0 ATLAS_2019_I1736531
 # CMS Z UE
 insert /Herwig/Analysis/RivetAnalysis:Analyses 0 CMS_2017_I1635889
 # CMS Z
 insert /Herwig/Analysis/RivetAnalysis:Analyses 0 CMS_2019_I1753680:LMODE=MU
 insert /Herwig/Analysis/RivetAnalysis:Analyses 0 CMS_2019_I1753680:LMODE=EMU
 insert /Herwig/Analysis/RivetAnalysis:Analyses 0 CMS_2018_I1667854:LMODE=EMU
 # CMS mass spectrum
 insert /Herwig/Analysis/RivetAnalysis:Analyses 0 CMS_2018_I1711625
 # ATLAS high pt jets
 insert /Herwig/Analysis/RivetAnalysis:Analyses 0 ATLAS_2022_I2077570
 # CMS substructure
-insert /Herwig/Analysis/RivetAnalysis:Analyses 0 CMS_2021_I1920187_ZJET
+insert /Herwig/Analysis/RivetAnalysis:Analyses 0 CMS_2021_I1920187:MODE=ZJET
 
diff --git a/Tests/python/merge-LHC-EW.in b/Tests/python/merge-LHC-EW.in
--- a/Tests/python/merge-LHC-EW.in
+++ b/Tests/python/merge-LHC-EW.in
@@ -1,425 +1,428 @@
 #! @PYTHON@
 # -*- mode: python -*-
 from __future__ import print_function
 import logging, sys, os, yoda, math, subprocess, time
 
 """%prog
 
 Script for merging yoda files
 
 """
 
 def fillAbove(scale,desthisto, sourcehistosbyptmin) :
     pthigh= 1e100
     ptlow =-1e100
     for pt, h in sorted(sourcehistosbyptmin.items(),reverse=True):
         ptlow=pt
         if(type(desthisto)==yoda.core.Scatter2D) :
             for i in range(0,h.numPoints()) :
                 xMin = h.points()[i].x()-h.points()[i].xErrs().minus
                 if( xMin*scale >= ptlow and 
                     xMin*scale <  pthigh ) :
                     desthisto.addPoint(h.points()[i])
         elif(type(desthisto)==yoda.core.Profile1D) :
             for i in range(0,h.numBins()) :
                 if(h.bins()[i].xMin()*scale  >= ptlow and 
                    h.bins()[i].xMin()*scale  <  pthigh ) :
                     desthisto.bins()[i] += h.bins()[i]
         elif(type(desthisto)==yoda.core.Histo1D) :
             for i in range(0,h.numBins()) :
                 if(h.bins()[i].xMin()*scale  >= ptlow and 
                    h.bins()[i].xMin()*scale  <  pthigh ) :
                     desthisto.bins()[i] += h.bins()[i]
         else :
             logging.error("Can't merge %s, unknown type" % desthisto.path())
             sys.exit(1)
         pthigh=pt
 
 import sys
 if sys.version_info[:3] < (2,4,0):
     print ("rivet scripts require Python version >= 2.4.0... exiting")
     sys.exit(1)
 
 if __name__ == "__main__":
     import logging
     from optparse import OptionParser, OptionGroup
     parser = OptionParser(usage="%prog base")
     verbgroup = OptionGroup(parser, "Verbosity control")
     verbgroup.add_option("-v", "--verbose", action="store_const", const=logging.DEBUG, dest="LOGLEVEL",
                          default=logging.INFO, help="print debug (very verbose) messages")
     verbgroup.add_option("-q", "--quiet", action="store_const", const=logging.WARNING, dest="LOGLEVEL",
                          default=logging.INFO, help="be very quiet")
     parser.add_option_group(verbgroup)
     (opts, args) = parser.parse_args()
     logging.basicConfig(level=opts.LOGLEVEL, format="%(message)s")
 
     ## Check args
     if len(args) < 1:
         logging.error("Must specify at least the name of the files")
         sys.exit(1)
 
 # merge the mass hists
 yodafiles=["-13-Z-nu","-W-e","-W-mu","-Z-mu-Short","-8-W-e","-8-W-mu",
            "-WW-emu","-WW-ll","-13-WW-ll","-WZ","-ZZ-ll","-ZZ-lv","-13-ZZ-ll",
            "-8-WZ","-13-WZ","-8-ZZ-lv","-8-WW-ll",
            "-7-W-Jet-1-e","-7-W-Jet-2-e","-7-W-Jet-3-e","-7-Z-Jet-1-e","-7-Z-Jet-2-e","-7-Z-Jet-3-e",
            "-7-WGamma-e","-7-WGamma-mu","-7-ZGamma-e","-7-ZGamma-mu"]
 for energy in ["","8-","13-"] :
     for ll in ["e","mu"] :
         mergeargs=["rivet-merge"]
         for mass in range(1,6) : 
             fname = "Rivet-%s-%sZ-%s-Mass%s.yoda" % (args[0], energy , ll,mass)
             if(os.path.isfile(fname)) :
                 mergeargs.append(fname)
         if len(mergeargs)==1 : continue
         mergeargs.append("-o")
         mergeargs.append("Rivet-%s-%sZ-%s.yoda"% (args[0], energy ,ll))
         yodafiles.append("-%sZ-%s"% (energy ,ll))
         p = subprocess.Popen(mergeargs)
 time.sleep(5)
 
 ## Get histos
 outhistos={}
 for f in yodafiles:
     fname='Rivet-'+args[0]+f+".yoda"
     if not os.access(fname, os.R_OK):
         logging.error("%s can not be read" % fname)
         continue
     try:
         aos = yoda.read(fname)
     except:
         logging.error("%s can not be parsed as yoda" % fname)
         continue
     ## Get histos from this YODA file
     for aopath, ao in aos.items() :
         if "RAW" in aopath or "XSEC" in aopath or "EVTCOUNT" in aopath : continue
         if(aopath.find("ATLAS_2010_S8919674")>0) :
             if ("d01" in aopath or "d05" in aopath or "d07" in aopath) and "-e" in fname: 
                 outhistos[aopath] = ao
             elif ("d02" in aopath or "d06" in aopath or "d08" in aopath) and "-mu" in fname: 
                 outhistos[aopath] = ao
         elif (aopath.find("ATLAS_2011_S9131140")>0) :
             if("d01" in aopath and "-e" in fname) : 
                 outhistos[aopath] = ao
             elif("d02" in aopath and "-mu" in fname) : 
                 outhistos[aopath] = ao
         elif (aopath.find("ATLAS_2011_I925932")>0) :
             if("d01" in aopath and "-e" in fname) : 
                 outhistos[aopath] = ao
             elif("d02" in aopath and "-mu" in fname) : 
                 outhistos[aopath] = ao
         elif (aopath.find("ATLAS_2011_I945498")>0) :
             if(aopath.find("y01")>0 and "-e" in fname) : 
                 outhistos[aopath] = ao
             elif(aopath.find("y02")>0 and "-mu" in fname) : 
                 outhistos[aopath] = ao
             elif(aopath.find("y03")>0 and "-mu" in fname) : 
                 outhistos[aopath] = ao
         elif (aopath.find("ATLAS_2013_I1217867")>0) :
             if(aopath.find("y01")>0 and "-e" in fname) : 
                 outhistos[aopath] = ao
             elif(aopath.find("y02")>0 and "-mu" in fname) : 
                 outhistos[aopath] = ao
         elif (aopath.find("CMS_2012_I941555")>0) :
             if((aopath.find("y01")>0 or aopath.find("y03")>0 ) and "-mu" in fname) : 
                 outhistos[aopath] = ao
             elif(aopath.find("y02")>0 and "-e" in fname) : 
                 outhistos[aopath] = ao
         elif (aopath.find("ATLAS_2014_I1300647" )>0) :
             if(aopath.find("y01")>0 and "-e" in fname) : 
                 outhistos[aopath] = ao
             elif((not aopath.find("y01")>0) and "-mu" in fname) :
                 outhistos[aopath] = ao
         elif (aopath.find("ATLAS_2014_I1288706" )>0) :
             if(aopath.find("y02")>0 and "-e" in fname) : 
                 outhistos[aopath] = ao
             elif(aopath.find("y01")>0 and "-mu" in fname) :
                 outhistos[aopath] = ao
         elif (aopath.find("ATLAS_2012_I1204784" )>0) :
             if( "-e" in fname and
                 ( "d03" in aopath or 
                   (("d01" in aopath or "d02" in aopath) and aopath.find("y01")>0))) : 
                 outhistos[aopath] = ao
             elif("-mu" in fname and
                  ( "d04" in aopath or 
                    (("d01" in aopath or "d02" in aopath) and aopath.find("y02")>0))) : 
                 outhistos[aopath] = ao
         elif (aopath.find("ATLAS_2014_I1312627")>0) :
             if("EL" in aopath) :
                 if(fname.find("W")>0 and aopath.find("x02")>0) :
                     outhistos[aopath] = ao
                 elif(fname.find("Z")>0 and aopath.find("x03")>0) :
                     outhistos[aopath] = ao
             elif ("MU" in aopath) :
                 if(fname.find("W")>0 and aopath.find("x02")>0) :
                     outhistos[aopath] = ao
                 elif(fname.find("Z")>0 and aopath.find("x03")>0) :
                     outhistos[aopath] = ao
             else :
                 if(fname.find("W")>0 and aopath.find("x02")>0) :
                     outhistos[aopath] = ao
                 elif(fname.find("Z")>0 and aopath.find("x03")>0) :
                     outhistos[aopath] = ao
         elif (aopath.find("CMS_2018_I1711625")>0) :
             if( "-e" in fname and aopath.find("d06-x01-y01") > 0 ):
                 if aopath in outhistos :
                     outhistos[aopath] += ao
                 else :
                     outhistos[aopath]  = ao
             elif( "-mu" in fname and (aopath.find("d03-x01-y01") > 0 or aopath.find("d05-x01-y01") > 0) ):
                 if aopath in outhistos :
                     outhistos[aopath] += ao
                 else :
                     outhistos[aopath]  = ao
         elif (aopath.find("CMS_2013_I1224539_WJET" )>0) :
             if(fname.find("-1-e")>0 and (aopath.find("d52")>0 or aopath.find("d53")>0 or aopath.find("d56")>0 or aopath.find("d57")>0 or aopath.find("d60")>0 or aopath.find("d61")>0 or aopath.find("d64")>0 or aopath.find("d65")>0 or aopath.find("d68")>0 or aopath.find("d69")>0 or aopath.find("d72")>0)) :
                 outhistos[aopath] = ao
             elif(fname.find("-2-e")>0 and (aopath.find("d54")>0 or aopath.find("d58")>0 or aopath.find("d62")>0 or aopath.find("d66")>0 or aopath.find("d70")>0 or aopath.find("d73")>0)) :
                 outhistos[aopath] = ao
             elif(fname.find("-3-e")>0 and (aopath.find("d55")>0 or aopath.find("d59")>0 or aopath.find("d63")>0 or aopath.find("d67")>0 or aopath.find("d71")>0 or aopath.find("d74")>0)) :
                 outhistos[aopath] = ao
         elif (aopath.find("CMS_2013_I1224539_ZJET" )>0) :
             if(fname.find("-1-e")>0 and (aopath.find("d29")>0 or aopath.find("d30")>0 or aopath.find("d33")>0 or aopath.find("d34")>0 or aopath.find("d37")>0 or aopath.find("d38")>0 or aopath.find("d41")>0 or aopath.find("d42")>0 or aopath.find("d45")>0 or aopath.find("d46")>0 or aopath.find("d49")>0)) :
                 outhistos[aopath] = ao
             elif(fname.find("-2-e")>0 and (aopath.find("d31")>0 or aopath.find("d35")>0 or aopath.find("d39")>0 or aopath.find("d43")>0 or aopath.find("d47")>0 or aopath.find("d50")>0)) :
                 outhistos[aopath] = ao
             elif(fname.find("-3-e")>0 and (aopath.find("d32")>0 or aopath.find("d36")>0 or aopath.find("d40")>0 or aopath.find("d44")>0 or aopath.find("d48")>0 or aopath.find("d51")>0)) :
                 outhistos[aopath] = ao
         elif (aopath.find("CMS_2013_I1258128")>0) :
             if("d01" in aopath or "d02" in aopath or
                "d03" in aopath or "d04" in aopath) :
                 outhistos[aopath] = ao
         elif (aopath.find("CMS_2013_I1209721" )>0 and fname.find("-0")>0 ) :
             outhistos[aopath] = ao
         elif (aopath.find("ATLAS_2011_I928289")>0) :
             if(fname.find("-e")>=0 and (aopath.find("y01")>=0 or aopath.find("y02")>=0)) :
                 outhistos[aopath] = ao
             elif(fname.find("-mu")>=0 and (aopath.find("y03")>=0 or aopath.find("y04")>=0)) :
                 outhistos[aopath] = ao
         elif (aopath.find("CMS_2013_I1122847")>0) :
             if(fname.find("-mu")>=0 and aopath.find("d01")>=0 ) :
                 outhistos[aopath] = ao
             elif(fname.find("-e")>=0 and (aopath.find("d02")>=0 or aopath.find("d03")>=0)) :
                 outhistos[aopath] = ao
         elif (aopath.find("ATLAS_2016_I1424838")>0) :
             ihist = int(aopath.split("/")[2].split("-")[0].replace("d",""))
             if(fname.find("-mu")>=0 and ihist>30 ) :
                 outhistos[aopath] = ao
             elif(fname.find("-e")>=0 and ihist<=30) :
                 outhistos[aopath] = ao
         elif "ATLAS_2016_I1502620" in aopath :
             newPath = aopath.split(":")[0]+"/"+aopath.split("/")[-1]
             if newPath in outhistos :
                 continue
             else :                
                 outhistos[newPath] = ao
                 ao.setPath(newPath)
         elif ("CMS_2015_I1310737" in aopath or "ATLAS_2013_I1219109" in aopath or
               ("ATLAS_2014_I1319490" in aopath and "y01" in aopath )) :
             if aopath in outhistos :
                 outhistos[aopath] += ao
             else :
                 outhistos[aopath] = ao
         elif (aopath.find("CMS_2016_I1471281")>=0) :
             if fname.find("W")>0 and "d08" in aopath :
                 outhistos[aopath] = ao
             elif fname.find("Z")>0 and "d09" in aopath :
                 outhistos[aopath] = ao
         elif (aopath.find("ATLAS_2015_I1351916")>=0) :
             if(aopath.find("-y02")>=0) :
                 pathBase = "/%s/" % aopath.split("/")[1]
                 if("d03" in aopath) :
                     hp = aos[pathBase+"_ncf_pos"]
                     hm = aos[pathBase+"_ncf_neg"]
                 else :
                     hp = aos[pathBase+"_ncc_pos"]
                     hm = aos[pathBase+"_ncc_neg"]
                 ratio = (hp-hm)/(hp+hm)
                 title=""
                 if hasattr(ao, 'title'):
                     title=ao.title()
                 hnew = yoda.core.Scatter2D(aopath,title)
                 hnew.combineWith(ratio)
                 outhistos[aopath] = hnew
             else :
                 continue
         elif (aopath.find("ATLAS_2014_I1282447")>=0) :
             if((aopath.find("/ATLAS_2014_I1282447/d02-x01-y01")>=0 or
                 aopath.find("/ATLAS_2014_I1282447/d08-x01-y01")>=0 or 
                 aopath.find("/ATLAS_2014_I1282447/d02-x01-y02")>=0 or 
                 aopath.find("/ATLAS_2014_I1282447/d02-x01-y01")>=0 or
                 aopath.find("/ATLAS_2014_I1282447/d05-x01-y02")>=0 or 
                 aopath.find("/ATLAS_2014_I1282447/d05-x01-y03")>=0 or 
                 aopath.find("/ATLAS_2014_I1282447/d06-x01-y01")>=0 or
                 aopath.find("/ATLAS_2014_I1282447/d06-x01-y02")>=0 or 
                 aopath.find("/ATLAS_2014_I1282447/d06-x01-y03")>=0 or 
                 aopath.find("/ATLAS_2014_I1282447/d06-x01-y04")>=0) and 
                not (aopath.find("plus")>=0 or aopath.find("minus")>=0 or
                     aopath.find("inc")>=0)) :
                 continue
             if aopath in outhistos :
                 outhistos[aopath] += ao
             else :
                 outhistos[aopath] = ao
         elif (aopath.find("ATLAS_2017_I1514251")>=0) :
             outhistos[aopath] = ao
             if(type(ao)==yoda.core.Scatter2D) :
                 ao.scaleY(2.)
             elif(type(ao)==yoda.core.Histo1D) :
                 ao.scaleW(2.)
         elif ( "2015_041_" in aopath) :
             aopath=aopath.replace("_EL","").replace("_MU","")
             ao.setPath(aopath)
             outhistos[aopath] = ao
         elif "CMS_2019_I1753680" in aopath :
             if("d26" in aopath or "d27" in aopath or "d28" in aopath) :
                 if ("y01" in aopath and "=MU" in aopath) or ("y02" in aopath and "=EL" in aopath) :
                     outhistos[aopath] = ao
                 elif ("y03" in aopath and "=EMU" in aopath) :
                     if aopath in outhistos :
                         outhistos[aopath] += ao
                     else :
                         outhistos[aopath] = ao
             elif  "=EMU" in aopath:
                 if aopath in outhistos :
                     outhistos[aopath] += ao
                     if "d29" not in aopath :
                         outhistos[aopath].scaleW(0.5)
                 else :
                     outhistos[aopath]  = ao
         elif "CMS_2018_I1667854" in aopath :
             if "=EMU" in aopath:
                 if aopath in outhistos :
                     outhistos[aopath] += ao
                 else :
                     outhistos[aopath]  = ao
         elif "ATLAS_2022_I2077570" in aopath or "CMS_2017_I1497519" in aopath :
                 if aopath in outhistos :
                     outhistos[aopath] += ao
                 else :
                     outhistos[aopath]  = ao
+        elif (aopath.find("CMS_2021_I1920187")>=0) :
+            ao.setPath(ao.path().replace(":MODE=ZJET",""))
+            outhistos[aopath.replace(":MODE=ZJET","")]  = ao
         else :
             outhistos[aopath] = ao
 # sort out ratios for ATLAS W+c
 if("/ATLAS_2014_I1282447/d02-x01-y01_plus" in outhistos and 
    "/ATLAS_2014_I1282447/d02-x01-y01_minus" in outhistos) :
     d02y01_plus  = outhistos["/ATLAS_2014_I1282447/d02-x01-y01_plus"]
     d02y01_minus = outhistos["/ATLAS_2014_I1282447/d02-x01-y01_minus"]
     ratio_d02y01 = d02y01_plus/d02y01_minus
     ratio_d02y01.setPath("/ATLAS_2014_I1282447/d02-x01-y01")
     del outhistos["/ATLAS_2014_I1282447/d02-x01-y01_plus"]
     del outhistos["/ATLAS_2014_I1282447/d02-x01-y01_minus"]
     outhistos["/ATLAS_2014_I1282447/d02-x01-y01"] = ratio_d02y01
 if("/ATLAS_2014_I1282447/d02-x01-y02_plus" in outhistos and 
    "/ATLAS_2014_I1282447/d02-x01-y02_minus" in outhistos) :
     d02y02_plus  = outhistos["/ATLAS_2014_I1282447/d02-x01-y02_plus"]
     d02y02_minus = outhistos["/ATLAS_2014_I1282447/d02-x01-y02_minus"]
     ratio_d02y02 = d02y02_plus/d02y02_minus
     ratio_d02y02.setPath("/ATLAS_2014_I1282447/d02-x01-y02")
     del outhistos["/ATLAS_2014_I1282447/d02-x01-y02_plus"]
     del outhistos["/ATLAS_2014_I1282447/d02-x01-y02_minus"]
     outhistos["/ATLAS_2014_I1282447/d02-x01-y02"] = ratio_d02y02
 if("/ATLAS_2014_I1282447/d08-x01-y01_plus" in outhistos and 
    "/ATLAS_2014_I1282447/d08-x01-y01_minus" in outhistos) :
     d08y01_plus  = outhistos["/ATLAS_2014_I1282447/d08-x01-y01_plus"]
     d08y01_minus = outhistos["/ATLAS_2014_I1282447/d08-x01-y01_minus"]
     ratio_d08y01 = d08y01_plus/d08y01_minus
     ratio_d08y01.setPath("/ATLAS_2014_I1282447/d08-x01-y01")
     del outhistos["/ATLAS_2014_I1282447/d08-x01-y01_plus"]
     del outhistos["/ATLAS_2014_I1282447/d08-x01-y01_minus"]
     outhistos["/ATLAS_2014_I1282447/d08-x01-y01"] = ratio_d08y01
 if ("/ATLAS_2014_I1282447/d05-x01-y01" in outhistos and
     "/ATLAS_2014_I1282447/d01-x01-y02" in outhistos) :
     h_winc = outhistos["/ATLAS_2014_I1282447/d05-x01-y01"]
     h_d    = outhistos["/ATLAS_2014_I1282447/d01-x01-y02"]
     ratio_wd      =  h_d/h_winc
     ratio_wd.setPath("/ATLAS_2014_I1282447/d05-x01-y02")
     outhistos["/ATLAS_2014_I1282447/d05-x01-y02"] = ratio_wd
 if ("/ATLAS_2014_I1282447/d05-x01-y01" in outhistos and
     "/ATLAS_2014_I1282447/d01-x01-y03" in outhistos) :
     h_winc = outhistos["/ATLAS_2014_I1282447/d05-x01-y01"]
     h_dstar= outhistos["/ATLAS_2014_I1282447/d01-x01-y03"]
     ratio_wdstar      =  h_dstar/h_winc
     ratio_wdstar.setPath("/ATLAS_2014_I1282447/d05-x01-y03")
     outhistos["/ATLAS_2014_I1282447/d05-x01-y03"] = ratio_wdstar
 if("/ATLAS_2014_I1282447/d06-x01-y01_winc" in outhistos and
    "/ATLAS_2014_I1282447/d06-x01-y02_winc" in outhistos) :
     h_winc_plus  = outhistos["/ATLAS_2014_I1282447/d06-x01-y01_winc"]
     h_winc_minus = outhistos["/ATLAS_2014_I1282447/d06-x01-y02_winc"]
     if( "/ATLAS_2014_I1282447/d06-x01-y01_wplus" in outhistos ) :
         h_wd_plus      = outhistos["/ATLAS_2014_I1282447/d06-x01-y01_wplus"]
         ratio_wd_plus       =  h_wd_plus/h_winc_plus
         ratio_wd_plus.setPath("/ATLAS_2014_I1282447/d06-x01-y01")
         outhistos["/ATLAS_2014_I1282447/d06-x01-y01"] = ratio_wd_plus
         del outhistos["/ATLAS_2014_I1282447/d06-x01-y01_wplus"]
     if( "/ATLAS_2014_I1282447/d06-x01-y02_wminus" in outhistos ) :
         h_wd_minus     = outhistos["/ATLAS_2014_I1282447/d06-x01-y02_wminus"]
         ratio_wd_minus      =  h_wd_minus/h_winc_minus
         ratio_wd_minus.setPath("/ATLAS_2014_I1282447/d06-x01-y02")
         outhistos["/ATLAS_2014_I1282447/d06-x01-y02"] = ratio_wd_minus
         del outhistos["/ATLAS_2014_I1282447/d06-x01-y02_wminus"]
     if ( "/ATLAS_2014_I1282447/d06-x01-y03_wplus" in outhistos) : 
         h_wdstar_plus  = outhistos["/ATLAS_2014_I1282447/d06-x01-y03_wplus"]
         ratio_wdstar_plus       =  h_wdstar_plus/h_winc_plus
         ratio_wdstar_plus.setPath("/ATLAS_2014_I1282447/d06-x01-y03")
         outhistos["/ATLAS_2014_I1282447/d06-x01-y03"] = ratio_wdstar_plus 
         del outhistos["/ATLAS_2014_I1282447/d06-x01-y03_wplus"]
     if ( "/ATLAS_2014_I1282447/d06-x01-y04_wminus" in outhistos) :
         h_wdstar_minus = outhistos["/ATLAS_2014_I1282447/d06-x01-y04_wminus"]
         ratio_wdstar_minus      =  h_wdstar_minus/h_winc_minus
         ratio_wdstar_minus.setPath("/ATLAS_2014_I1282447/d06-x01-y04")
         outhistos["/ATLAS_2014_I1282447/d06-x01-y04"] = ratio_wdstar_minus
         del outhistos["/ATLAS_2014_I1282447/d06-x01-y04_wminus"]
     del outhistos["/ATLAS_2014_I1282447/d06-x01-y01_winc"]
     del outhistos["/ATLAS_2014_I1282447/d06-x01-y02_winc"]
     
 # ATLAS W/Z ratios
 iy=0
 for suffix in ["",":LMODE=EL",":LMODE=MU"] :
     iy+=1
     basePath = "/ATLAS_2014_I1312627%s/" % suffix
     for ihist in range(1,21) :
         num = "%sd%02d-x02-y%02d" % (basePath,ihist,iy) 
         den = "%sd%02d-x03-y%02d" % (basePath,ihist,iy)
         if(den in outhistos and num in outhistos) :
             ratio = outhistos[num]/outhistos[den]
             ratio.setPath("%sd%02d-x01-y%02d" % (basePath,ihist,iy))
             del outhistos[num]
             del outhistos[den]
             outhistos[ "%sd%02d-x01-y%02d" % (basePath,ihist,iy)]=ratio
         elif den in outhistos :
             del outhistos[den]
         elif num in outhistos :
             del outhistos[num]
 # LHCB W/Z + jets
 if("/LHCB_2016_I1454404:MODE=WJET/d01-x01-y01" in outhistos and
    "/LHCB_2016_I1454404:MODE=WJET/d01-x01-y02" in outhistos and
    "/LHCB_2016_I1454404:MODE=ZJET/d01-x01-y03" in outhistos) :
     hZ = outhistos["/LHCB_2016_I1454404:MODE=ZJET/d01-x01-y03"]
     hWp= outhistos["/LHCB_2016_I1454404:MODE=WJET/d01-x01-y01"]
     hWm= outhistos["/LHCB_2016_I1454404:MODE=WJET/d01-x01-y02"]
     hsum=hWp+hWm
     r1=hsum/hZ
     r1.setPath("/LHCB_2016_I1454404/d02-x01-y01")
     outhistos["/LHCB_2016_I1454404/d02-x01-y01"]=r1
     r1=hWp/hZ
     r1.setPath("/LHCB_2016_I1454404/d02-x01-y02")
     outhistos["/LHCB_2016_I1454404/d02-x01-y02"]=r1
     r1=hWm/hZ
     r1.setPath("/LHCB_2016_I1454404/d02-x01-y03")
     outhistos["/LHCB_2016_I1454404/d02-x01-y03"]=r1
 # Choose output file
 name = args[0]+"-EW.yoda"
 # remove any scatters with nans, causes yoda to crash
 remove = [] 
 for key in outhistos.keys() :
     ao = outhistos[key]
     if type(ao)==yoda.core.Scatter2D :
         skip=False
         for p in ao.points() :
             if math.isnan(p.y()) : skip=True
         if(skip) : remove.append(key)
 for key in remove : del outhistos[key]
 # output the yoda file
 yoda.writeYODA(outhistos,name)
 sys.exit(0)
diff --git a/Tests/python/merge-LHC-Jets.in b/Tests/python/merge-LHC-Jets.in
--- a/Tests/python/merge-LHC-Jets.in
+++ b/Tests/python/merge-LHC-Jets.in
@@ -1,1778 +1,1780 @@
 #! @PYTHON@
 # -*- mode: python -*-
 from __future__ import print_function
 import logging, sys, math
 
 if sys.version_info[:3] < (2,4,0):
     print ("rivet scripts require Python version >= 2.4.0... exiting")
     sys.exit(1)
 
 import os, yoda
 
 # #############################################
 
 def rescale(path,scale) :
     if(path not in outhistos) : return
     outhistos[path].scaleW(scale)
 
 def fillAbove(scale,desthisto, sourcehistosbyptmin) :
     pthigh= 1e100
     ptlow =-1e100
     for pt, h in sorted(sourcehistosbyptmin.items(),reverse=True):
         ptlow=pt
         if(type(desthisto)==yoda.core.Scatter2D) :
             for i in range(0,h.numPoints()) :
                 xMin = h.points()[i].x()-h.points()[i].xErrs().minus
                 if( xMin*scale >= ptlow and 
                     xMin*scale <  pthigh ) :
                     desthisto.addPoint(h.points()[i])
         elif(type(desthisto)==yoda.core.Profile1D) :
             for i in range(0,h.numBins()) :
                 if(h.bins()[i].xMin()*scale  >= ptlow and 
                    h.bins()[i].xMin()*scale  <  pthigh ) :
                     desthisto.bins()[i] += h.bins()[i]
         elif(type(desthisto)==yoda.core.Histo1D) :
             for i in range(0,h.numBins()) :
                 if(h.bins()[i].xMin()*scale  >= ptlow and 
                    h.bins()[i].xMin()*scale  <  pthigh ) :
                     desthisto.bins()[i] += h.bins()[i]
         elif(type(desthisto)==yoda.core.Counter) :
                     desthisto += h
         else :
             logging.error("Can't merge %s, unknown type" % desthisto.path())
             sys.exit(1)
         pthigh=pt
 
 def mergeByPt(hpath, sqrts, scale=1.) :
     global inhistos_pt
     global outhistos
     try:
         fillAbove(scale,outhistos[hpath], inhistos_pt[hpath][float(sqrts)])
     except:
         pass
 
 def mergeByMass(hpath, sqrts, scale=1.):
     global inhistos_mass
     global outhistos
     try:
         fillAbove(scale,outhistos[hpath], inhistos_mass[hpath][float(sqrts)])
     except:
         pass
 
 def useOnePt(hpath, sqrts, ptmin):
     global inhistos_pt
     global outhistos
     try:
        ## Find best pT_min match
         ptmins = inhistos_pt[hpath][float(sqrts)].keys()
         closest_ptmin = None
         for ptm in ptmins:
             if closest_ptmin is None or \
                     abs(ptm-float(ptmin)) < abs(closest_ptmin-float(ptmin)):
                 closest_ptmin = ptm
         if closest_ptmin != float(ptmin):
             logging.warning("Inexact match for requested pTmin=%s: " % ptmin + \
                                 "using pTmin=%e instead" % closest_ptmin)
         outhistos[hpath] =  inhistos_pt[hpath][float(sqrts)][closest_ptmin]
     except:
         pass
 
 def useOneMass(hpath, sqrts, ptmin):
     global inhistos_pt
     global outhistos
     try:
         ## Find best pT_min match
         ptmins = inhistos_mass[hpath][float(sqrts)].keys()
         closest_ptmin = None
         for ptm in ptmins:
             if closest_ptmin is None or \
                abs(ptm-float(ptmin)) < abs(closest_ptmin-float(ptmin)):
                 closest_ptmin = ptm
         if closest_ptmin != float(ptmin):
             logging.warning("Inexact match for requested mass=%s: " % ptmin + \
                             "using mass=%e instead" % closest_ptmin)
         outhistos[hpath] =  inhistos_mass[hpath][float(sqrts)][closest_ptmin]
     except:
         pass
 
 # #######################################
 
 if __name__ == "__main__":
     import logging
     from optparse import OptionParser, OptionGroup
     parser = OptionParser(usage="%prog name")
     verbgroup = OptionGroup(parser, "Verbosity control")
     parser.add_option("--with-ue",
                       action='store_true' ,
                       dest="ue",
                       default=True,
                       help="Include UE analyses")
     parser.add_option("--without-ue",
                       action='store_false',
                       dest="ue",
                       default=True,
                       help="Don\'t include UE analyses")
     verbgroup.add_option("-v", "--verbose", action="store_const", const=logging.DEBUG, dest="LOGLEVEL",
                          default=logging.INFO, help="print debug (very verbose) messages")
     verbgroup.add_option("-q", "--quiet", action="store_const", const=logging.WARNING, dest="LOGLEVEL",
                          default=logging.INFO, help="be very quiet")
     parser.add_option_group(verbgroup)
     (opts, args) = parser.parse_args()
     logging.basicConfig(level=opts.LOGLEVEL, format="%(message)s")
 
     (opts, args) = parser.parse_args()
 
     ## Check args
     if len(args) < 1:
         logging.error("Must specify at least the name of the files")
         sys.exit(1)
 yodafiles=["-7-Bottom-0.yoda","-7-Bottom-1.yoda","-7-Bottom-2.yoda",
            "-7-Bottom-3.yoda","-7-Bottom-4.yoda","-7-Bottom-5.yoda","-7-Bottom-6.yoda",
            "-13-Bottom-0.yoda","-13-Bottom-1.yoda","-13-Bottom-2.yoda",
            "-13-Bottom-3.yoda","-13-Bottom-4.yoda","-13-Bottom-5.yoda","-13-Bottom-6.yoda",
            "-7-Charm-1.yoda","-7-Charm-2.yoda",
            "-7-Charm-3.yoda","-7-Charm-4.yoda","-7-Charm-5.yoda",
            "-7-Top-SL.yoda","-7-Top-L.yoda",
            "-8-Top-SL.yoda","-8-Top-L.yoda","-8-Top-All.yoda",
            "-13-Top-L.yoda","-13-Top-SL.yoda","-13-Top-All.yoda"]
 
 for i in range(1,11) :
     for j in [7,8,13] :
         yodafiles.append("-%1.1i-Jets-%1.1i.yoda" % (j,i))
         
 for i in range(1,4) :
     yodafiles.append("-2760-Jets-%1.1i.yoda" % i)
 
 if(opts.ue) :
     yodafiles += ["-7-Jets-0.yoda"    ,"-8-Jets-0.yoda" ,
                   "-900-UE.yoda"   ,"-2360-UE.yoda"    ,
                   "-2760-UE.yoda"     ,"-7-UE.yoda"     ,
                   "-900-UE-Long.yoda" ,"-8-UE.yoda"     ,
                   "-7-UE-Long.yoda","-13-UE.yoda","-13-UE-Long.yoda"]
 #                  "-7-UE-Cent.yoda","-13-UE-Cent.yoda"]
 ## Get histos
 inhistos_pt   = {}
 inhistos_mass = {}
 outhistos={}
 weights = {}
 for f in yodafiles:
     file='Rivet-'+args[0]+f
     ptmin=0.
     sqrts=7000
     # CMS energy
     if(file.find("-900-")>0) :
         sqrts=900
     elif(file.find("-2360-")>0) :
         sqrts=2360
     elif(file.find("-2760-")>0) :
         sqrts=2760
     elif(file.find("-7-")>=0) :
         sqrts=7000
     elif(file.find("-8-")>=0) :
         sqrts=8000
     elif(file.find("-13-")>0) :
         sqrts=13000
     # pT min
     if(file.find("UE")>0) :
         ptmin=0.
     elif(file.find("Jets-0")>0) :
         ptmin=4.
     elif(file.find("Jets-10")>0) :
         ptmin=1900.
     elif(file.find("Jets-1")>0) :
         if( not opts.ue) :
             ptmin = 10.
         else :
             ptmin = 20.
     elif(file.find("Jets-2")>0) :
         ptmin=40.
     elif(file.find("Jets-3")>0) :
         ptmin=80.
     elif(file.find("Jets-4")>0) :
         ptmin=110.
     elif(file.find("Jets-5")>0) :
         ptmin=210.
     elif(file.find("Jets-6")>0) :
         ptmin=260.
     elif(file.find("Jets-7")>0) :
         ptmin=400.
     elif(file.find("Jets-8")>0) :
         ptmin=600.
     elif(file.find("Jets-9")>0) :
         ptmin=900.
     elif(file.find("Bottom-0")>0) :
         ptmin=0.
     elif(file.find("Bottom-1")>0 or file.find("Charm-1")>0) :
         ptmin=10.
     elif(file.find("Bottom-2")>0 or file.find("Charm-2")>0) :
         ptmin=20.
     elif(file.find("Bottom-3")>0 or file.find("Charm-3")>0) :
         ptmin=30.
     elif(file.find("Bottom-4")>0 or file.find("Charm-4")>0) :
         ptmin=70.
     elif(file.find("Bottom-5")>0 or file.find("Charm-5")>0) :
         ptmin=100.
     elif(file.find("Bottom-6")>0 or file.find("Charm-6")>0) :
         ptmin=130.
     elif(file.find("Top-SL.yoda")>0 or file.find("Top-L.yoda")>0 or \
          file.find("Top-All.yoda")>0):
         ptmin=0.
     if not os.access(file, os.R_OK):
         logging.error("%s can not be read" % file)
         continue
     try:
         aos = yoda.read(file)
     except:
         logging.error("%s can not be parsed as YODA" % file)
         continue
     ## Get histos from this YODA file
     for aopath, ao in aos.items() :
+        aopath=aopath.replace(":MODE=DIJET","")
+        ao.setPath(ao.path().replace(":MODE=DIJET",""))
         if "RAW" in aopath : continue
         if("S8924791" in aopath or "S8971293" in aopath or
            "S8817804" in aopath or "I1082936" in aopath or
            "S8994773" in aopath or "S8918562" in aopath or
            "S8624100" in aopath or "S8625980" in aopath or
            "S8894728" in aopath or "S8957746" in aopath or
            "S9126244" in aopath or "S9120041" in aopath or
            "S8950903" in aopath or "S9086218" in aopath or
            "S9088458" in aopath or "I919017"  in aopath or
            "I926145"  in aopath or "S8941262" in aopath or
            "S8973270" in aopath or "I1118269" in aopath or
            "I1188891" in aopath or "I1082009" in aopath or
            "I1087342" in aopath or "S9035664" in aopath or
            "I1125575" in aopath or "I1094564" in aopath or
            "I930220"  in aopath or "I1224539" in aopath or
            "I1273574" in aopath or "I1261026" in aopath or
            "I1307243" in aopath or "I1325553" in aopath or
            "I1298810" in aopath or "I1298811" in aopath or
            "I1208923" in aopath or "I1305624" in aopath or
            "I1419070" in aopath or "I1394679" in aopath or
            "I929691"  in aopath or "I1393758" in aopath or
            "I1459051" in aopath or "I1487277" in aopath or
            "I1421646" in aopath or "I1111014" in aopath or
            "I1605749" in aopath or "I1682495" in aopath or
            "I1609253" in aopath or "1385107"  in aopath or
            "I1486238" in aopath or "1634970"  in aopath or
            "I1604271" in aopath or "I1598460" in aopath or
            "I1643640" in aopath or "I1808726" in aopath or
            "I1724098" in aopath or "I1719955" in aopath or
            "I1740909" in aopath or "I1913061" in aopath or
            "I1932460" in aopath or
-           "I1972986" in aopath or "CMS_2021_I1920187_DIJET" in aopath or 
+           "I1972986" in aopath or "I1920187" in aopath or 
            "ATLAS_2016_CONF_2016_092" in aopath or
            "CMS_2012_PAS_QCD_11_010" in aopath) :
            if("1419070" in aopath and ("forward" in aopath or "central" in aopath )) :
                continue
            if aopath not in inhistos_pt:
                inhistos_pt[aopath] = {}
            tmpE = inhistos_pt[aopath]
            if sqrts not in tmpE:
                tmpE[sqrts] = {}
            if ptmin not in tmpE[sqrts]:
                tmpE[sqrts][ptmin] = ao
            else:
                tmpE[sqrts][ptmin] += ao
                #raise Exception("A set with ptmin = %s already exists" % ( ptmin))
         else :
             if("1509919" in aopath and "Ctr_cut" in aopath) :
                 continue
             elif "I1393758" in aopath and ("d02" in aopath or "d04" in aopath or
                                            "d06" in aopath or "d08" in aopath or
                                            "d10" in aopath or "d12" in aopath) :
                 continue
             elif "1387176" in aopath and "y02" in aopath:
                 continue
             elif "1454211" in aopath and "cutflow" in aopath :
                 continue
             elif("ATLAS_2016_I1468168" in aopath) :
                 newPath=aopath.replace("Passed_events","d02-x01-y01")
                 outhistos[newPath] = ao
                 ao.setPath(newPath)
             elif(aopath.find("I1243871")>0) :
                 if(aopath.find("x01")>0 and file.find("-7-Top-L.yoda")>0 ) :
                     outhistos[aopath] = ao
                 elif(aopath.find("x02")>0 and file.find("-7-Top-SL.yoda")>0 ) :
                     outhistos[aopath] = ao
             elif(aopath.find("1467230")>0 or aopath.find("1419652")>0) :
                 if(aopath.find("y01")>0 and file.find("Long")>0 ) :
                     outhistos[aopath] = ao
                 elif(aopath.find("y02")>0 and file.find("Long")<0 ) :
                     outhistos[aopath] = ao
             elif("CMS_2017_I1471287" in aopath) :
                 if("CMS_2017_I1471287/d" in aopath) :
                     outhistos[aopath] = ao
             elif("ATLAS_2018_I1705857" in aopath ) :
                 ihist = int(aopath.split("/d")[1].split("-")[0])
                 if "-SL" in file :
                     if ihist in [9,10,11,12,19,20,21,22,23,24,25,26,33,34,35,36,37,38,45,46,47,48,49,50] :
                         outhistos[aopath] = ao
                 elif "-L" in file :
                     if ihist in [3,4,5,6,7,8,13,14,15,16,17,18,27,28,29,30,31,32,39,40,41,42,43,44]  :
                         outhistos[aopath] = ao
                 if ihist in [1,2] :
                     if aopath not in outhistos :
                         outhistos[aopath] = ao
                     else :
                         title=""
                         path=""
                         if hasattr(ao, 'title'):
                             title=ao.title()
                         if hasattr(ao, 'path'):
                             path=ao.path()
                         temp = yoda.core.Histo1D(path,title)
                         for i in range(0,ao.numBins()) :
                             temp.addBin(ao.bins()[i].xMin(),ao.bins()[i].xMax())
                         if("-SL" in file) :
                             temp.bins()[0] += outhistos[aopath].bins()[0]
                             temp.bins()[1] += outhistos[aopath].bins()[1]
                             temp.bins()[2] += ao.bins()[2]
                             temp.bins()[3] += ao.bins()[3]
                             temp.bins()[2] += ao.bins()[2]
                             temp.bins()[3] += ao.bins()[3]
                         else :
                             temp.bins()[0] += ao.bins()[0]
                             temp.bins()[1] += ao.bins()[1]
                             temp.bins()[2] += outhistos[aopath].bins()[2]
                             temp.bins()[3] += outhistos[aopath].bins()[3]
                             temp.bins()[2] += outhistos[aopath].bins()[2]
                             temp.bins()[3] += outhistos[aopath].bins()[3]
                         outhistos[aopath] = temp
             elif "ATLAS_2018_I1707015" in aopath :
                 if "d03" in aopath or "d04" in aopath or "d05" in aopath:
                     if "Top-SL" in file:
                         outhistos[aopath] = ao
                 else :
                     if( "Top-L" in file ) :
                         outhistos[aopath] = ao
             else :
                 outhistos[aopath] = ao
 
 
 
 yodafiles=["-7-Bottom-7.yoda","-7-Bottom-8.yoda","-7-Bottom-9.yoda"]
 for i in range(1,8) :
     yodafiles.append("-7-DiJets-%1.1i-A.yoda" % i)
     yodafiles.append("-7-DiJets-%1.1i-B.yoda" % i)
     yodafiles.append("-7-DiJets-%1.1i-C.yoda" % i)
 for i in range(1,12) :
     yodafiles.append("-13-DiJets-%1.1i-A.yoda" % i)
 # for i in range(6,12) :
 #     yodafiles.append("-13-DiJets-%1.1i-B.yoda" % i)
 
 for f in yodafiles:
     file='Rivet-'+args[0]+f
     if    "-7-Jets" in file or  "-7-DiJets" in file or "-7-Bottom" in file :
         sqrts =  7000
     elif "-13-Jets" in file or "-13-DiJets" in file :
         sqrts = 13000
     if(file.find("-DiJets-2")>0) :
         mass=250
     elif(file.find("-DiJets-3")>0) :
         mass=500
     elif(file.find("-DiJets-4")>0) :
         mass=800
     elif(file.find("-DiJets-5")>0) :
         mass=1000
     elif(file.find("-DiJets-6")>0) :
         mass=1600
     elif(file.find("-DiJets-7")>0) :
         mass=2200
     elif(file.find("-DiJets-8")>0) :
         mass=2800
     elif(file.find("-DiJets-9")>0) :
         mass=3900
     elif(file.find("-DiJets-10")>0) :
         mass=4900
     elif(file.find("-DiJets-11")>0) :
         mass=5900
     elif(file.find("-DiJets-1")>0) :
         mass=100
     elif(file.find("-Bottom-7")>0) :
         mass=110
     elif(file.find("-Bottom-8")>0) :
         mass=370
     elif(file.find("-Bottom-9")>0) :
         mass=550
     elif(file.find("-Jets-1")>0) :
         mass=0
     if not os.access(file, os.R_OK):
         logging.error("%s can not be read" % file)
         continue
     try:
         aos = yoda.read(file)
     except:
         logging.error("%s can not be parsed as YODA" % file)
         continue
     ## Get histos from this YODA file
     for aopath, ao in aos.items() :
         if("RAW" in aopath) :continue
         if(aopath.find("8817804")>0 or aopath.find("8968497")>0 or 
            aopath.find("1082936")>0 or aopath.find("I930220")>0 or
            aopath.find("1261026")>0 or aopath.find("1090423")>0 or
            aopath.find("1268975")>0 or aopath.find("1519995") >0 or
            aopath.find("1663452") >0 or
            aopath.find("1634970" )>0 or
            aopath.find("CMS_2013_I1208923")>0) :
            if aopath not in inhistos_mass:
                inhistos_mass[aopath] = {}
            tmpE = inhistos_mass[aopath]
            if sqrts not in tmpE:
                tmpE[sqrts] = {}
            tmpP = tmpE[sqrts]
            if mass not in tmpP:
                tmpP[mass] = ao
            else:
                print (aopath)
                print (sqrts,mass,file)
                raise Exception("A set with mass = %s already exists" % ( mass))
 
 
         
 ## Make empty output histos if needed
 for hpath,hsets in inhistos_pt.items():
     if( "8924791"  in hpath or "8971293" in hpath or 
         "8817804"  in hpath or "8968497" in hpath or 
         ("9120041" in hpath and ("d01" in hpath or "d02" in hpath)) or 
         "9126244"  in hpath or "926145"     in hpath or 
         "9086218"  in hpath or "1082936"    in hpath or 
         "8941262"  in hpath or "1118269"    in hpath or 
         "1087342"  in hpath or "1188891"    in hpath or
         "919017"   in hpath or "9035664"    in hpath or
         "1125575"  in hpath or "1094564"    in hpath or
         "I930220"  in hpath or "S9088458"   in hpath or 
         "I1273574" in hpath or "I1261026"   in hpath or 
         "I1090423" in hpath or "QCD_11_010" in hpath or
         "1298811"  in hpath or "I1325553"   in hpath or
         "I1298810" in hpath or "1307243"    in hpath or
         "I1419070" in hpath or "I1394679"   in hpath or
         "I1487277" in hpath or "I1604271"   in hpath or
         "I1598460" in hpath or "CMS_2013_I1208923" in hpath or
         "1393758" in hpath or"ATLAS_2016_CONF_2016_092" in hpath or
         "1111014" in hpath or "1385107" in hpath or "I1486238" in hpath or
         "1459051" in hpath or "1634970" in hpath or "I1740909" in hpath or
         "1913061" in hpath or "I1972986" in hpath or "I1932460" in hpath ) :
         title=""
         path=""
         histo = list(list(hsets.values())[0].values())[0]
         if hasattr(histo, 'title'):
             title=histo.title()
         if hasattr(histo, 'path'):
             path=histo.path()
         if(type(histo)==yoda.core.Counter) :
             outhistos[hpath] = yoda.core.Counter(path,title)
         elif(type(histo)==yoda.core.Scatter2D) :
             outhistos[hpath] = yoda.core.Scatter2D(path,title)
         elif(type(histo)==yoda.core.Profile1D) :
             outhistos[hpath] = yoda.core.Profile1D(path,title)
             for i in range(0,histo.numBins()) :
                 outhistos[hpath].addBin(histo.bins()[i].xMin(),
                                         histo.bins()[i].xMax())
         elif(type(histo)==yoda.core.Histo1D) :
             outhistos[hpath] = yoda.core.Histo1D(path,title)
             for i in range(0,histo.numBins()) :
                 outhistos[hpath].addBin(histo.bins()[i].xMin(),
                                         histo.bins()[i].xMax())
         else :
             logging.error("Histogram %s is of unknown type" % hpath)
             sys.exit(1) 
 
 ## Make empty output histos if needed
 for hpath,hsets in inhistos_mass.items():
     if("1268975" in hpath or "1634970" in hpath) :
         title=""
         path=""
         histo = list(list(hsets.values())[0].values())[0]
         if hasattr(histo, 'title'):
             title=histo.title()
         if hasattr(histo, 'path'):
             path=histo.path()
         if(type(histo)==yoda.core.Counter) :
             outhistos[hpath] = yoda.core.Counter(path,title)
         elif(type(histo)==yoda.core.Scatter2D) :
             outhistos[hpath] = yoda.core.Scatter2D(path,title)
         elif(type(histo)==yoda.core.Profile1D) :
             outhistos[hpath] = yoda.core.Profile1D(path,title)
             for i in range(0,histo.numBins()) :
                 outhistos[hpath].addBin(histo.bins()[i].xMin(),
                                         histo.bins()[i].xMax())
         elif(type(histo)==yoda.core.Histo1D) :
             outhistos[hpath] = yoda.core.Histo1D(path,title)
             for i in range(0,histo.numBins()) :
                 outhistos[hpath].addBin(histo.bins()[i].xMin(),
                                         histo.bins()[i].xMax())
         else :
             logging.error("Histogram %s is of unknown type" % hpath)
             sys.exit(1)
         
 
 logging.info("Processing CMS_2011_S8957746")
 useOnePt("/CMS_2011_S8957746/d01-x01-y01", "7000", "80" )
 useOnePt("/CMS_2011_S8957746/d02-x01-y01", "7000", "80" )
 useOnePt("/CMS_2011_S8957746/d03-x01-y01", "7000", "110" )
 useOnePt("/CMS_2011_S8957746/d04-x01-y01", "7000", "110" )
 useOnePt("/CMS_2011_S8957746/d05-x01-y01", "7000", "210" )
 useOnePt("/CMS_2011_S8957746/d06-x01-y01", "7000", "210" )
 
 logging.info("Processing ATLAS_2010_S8894728")
 useOnePt("/ATLAS_2010_S8894728/d01-x01-y01",  "900", "0" )
 useOnePt("/ATLAS_2010_S8894728/d01-x01-y02",  "900", "0" )
 useOnePt("/ATLAS_2010_S8894728/d01-x01-y03",  "900", "0" )
 useOnePt("/ATLAS_2010_S8894728/d02-x01-y01", "7000", "0" )
 useOnePt("/ATLAS_2010_S8894728/d02-x01-y02", "7000", "0" )
 useOnePt("/ATLAS_2010_S8894728/d02-x01-y03", "7000", "0" )
 useOnePt("/ATLAS_2010_S8894728/d03-x01-y01",  "900", "0" )
 useOnePt("/ATLAS_2010_S8894728/d03-x01-y02",  "900", "0" )
 useOnePt("/ATLAS_2010_S8894728/d03-x01-y03",  "900", "0" )
 useOnePt("/ATLAS_2010_S8894728/d04-x01-y01", "7000", "0" )
 useOnePt("/ATLAS_2010_S8894728/d04-x01-y02", "7000", "0" )
 useOnePt("/ATLAS_2010_S8894728/d04-x01-y03", "7000", "0" )
 useOnePt("/ATLAS_2010_S8894728/d05-x01-y01",  "900", "0" )
 useOnePt("/ATLAS_2010_S8894728/d06-x01-y01", "7000", "0" )
 useOnePt("/ATLAS_2010_S8894728/d07-x01-y01",  "900", "0" )
 useOnePt("/ATLAS_2010_S8894728/d08-x01-y01", "7000", "0" )
 useOnePt("/ATLAS_2010_S8894728/d09-x01-y01",  "900", "0" )
 useOnePt("/ATLAS_2010_S8894728/d09-x01-y02",  "900", "0" )
 useOnePt("/ATLAS_2010_S8894728/d09-x01-y03",  "900", "0" )
 useOnePt("/ATLAS_2010_S8894728/d10-x01-y01", "7000", "0" )
 useOnePt("/ATLAS_2010_S8894728/d10-x01-y02", "7000", "0" )
 useOnePt("/ATLAS_2010_S8894728/d10-x01-y03", "7000", "0" )
 useOnePt("/ATLAS_2010_S8894728/d11-x01-y01",  "900", "0" )
 useOnePt("/ATLAS_2010_S8894728/d11-x01-y02",  "900", "0" )
 useOnePt("/ATLAS_2010_S8894728/d11-x01-y03",  "900", "0" )
 useOnePt("/ATLAS_2010_S8894728/d12-x01-y01", "7000", "0" )
 useOnePt("/ATLAS_2010_S8894728/d12-x01-y02", "7000", "0" )
 useOnePt("/ATLAS_2010_S8894728/d12-x01-y03", "7000", "0" )
 useOnePt("/ATLAS_2010_S8894728/d13-x01-y01",  "900", "0" )
 useOnePt("/ATLAS_2010_S8894728/d13-x01-y02",  "900", "0" )
 useOnePt("/ATLAS_2010_S8894728/d13-x01-y03",  "900", "0" )
 useOnePt("/ATLAS_2010_S8894728/d13-x01-y04",  "900", "0" )
 useOnePt("/ATLAS_2010_S8894728/d14-x01-y01", "7000", "0" )
 useOnePt("/ATLAS_2010_S8894728/d14-x01-y02", "7000", "0" )
 useOnePt("/ATLAS_2010_S8894728/d14-x01-y03", "7000", "0" )
 useOnePt("/ATLAS_2010_S8894728/d14-x01-y04", "7000", "0" )
 useOnePt("/ATLAS_2010_S8894728/d15-x01-y01",  "900", "0" )
 useOnePt("/ATLAS_2010_S8894728/d15-x01-y02",  "900", "0" )
 useOnePt("/ATLAS_2010_S8894728/d15-x01-y03",  "900", "0" )
 useOnePt("/ATLAS_2010_S8894728/d15-x01-y04",  "900", "0" )
 useOnePt("/ATLAS_2010_S8894728/d16-x01-y01", "7000", "0" )
 useOnePt("/ATLAS_2010_S8894728/d16-x01-y02", "7000", "0" )
 useOnePt("/ATLAS_2010_S8894728/d16-x01-y03", "7000", "0" )
 useOnePt("/ATLAS_2010_S8894728/d16-x01-y04", "7000", "0" )
 useOnePt("/ATLAS_2010_S8894728/d17-x01-y01",  "900", "0" )
 useOnePt("/ATLAS_2010_S8894728/d17-x01-y02",  "900", "0" )
 useOnePt("/ATLAS_2010_S8894728/d17-x01-y03",  "900", "0" )
 useOnePt("/ATLAS_2010_S8894728/d18-x01-y01", "7000", "0" )
 useOnePt("/ATLAS_2010_S8894728/d18-x01-y02", "7000", "0" )
 useOnePt("/ATLAS_2010_S8894728/d18-x01-y03", "7000", "0" )
 useOnePt("/ATLAS_2010_S8894728/d19-x01-y01",  "900", "0" )
 useOnePt("/ATLAS_2010_S8894728/d19-x01-y02",  "900", "0" )
 useOnePt("/ATLAS_2010_S8894728/d19-x01-y03",  "900", "0" )
 useOnePt("/ATLAS_2010_S8894728/d20-x01-y01", "7000", "0" )
 useOnePt("/ATLAS_2010_S8894728/d20-x01-y02", "7000", "0" )
 useOnePt("/ATLAS_2010_S8894728/d20-x01-y03", "7000", "0" )
 useOnePt("/ATLAS_2010_S8894728/d21-x01-y01", "7000", "0" )
 useOnePt("/ATLAS_2010_S8894728/d22-x01-y01", "7000", "0" )
 
 logging.info("Processing ATLAS_2011_S8994773")
 useOnePt("/ATLAS_2011_S8994773/d01-x01-y01", "900", "0" )
 useOnePt("/ATLAS_2011_S8994773/d02-x01-y01", "7000", "0" )
 useOnePt("/ATLAS_2011_S8994773/d03-x01-y01", "900", "0" )
 useOnePt("/ATLAS_2011_S8994773/d04-x01-y01", "7000", "0" )
 useOnePt("/ATLAS_2011_S8994773/d13-x01-y01", "900", "0" )
 useOnePt("/ATLAS_2011_S8994773/d13-x01-y02", "900", "0" )
 useOnePt("/ATLAS_2011_S8994773/d13-x01-y03", "900", "0" )
 useOnePt("/ATLAS_2011_S8994773/d14-x01-y01", "7000", "0" )
 useOnePt("/ATLAS_2011_S8994773/d14-x01-y02", "7000", "0" )
 useOnePt("/ATLAS_2011_S8994773/d14-x01-y03", "7000", "0" )
 
 logging.info("Processing ALICE_2010_S8624100")
 useOnePt("/ALICE_2010_S8624100/d11-x01-y01", "900", "0" )
 useOnePt("/ALICE_2010_S8624100/d12-x01-y01", "900", "0" )
 useOnePt("/ALICE_2010_S8624100/d13-x01-y01", "900", "0" )
 useOnePt("/ALICE_2010_S8624100/d17-x01-y01","2360", "0" )
 useOnePt("/ALICE_2010_S8624100/d18-x01-y01","2360", "0" )
 useOnePt("/ALICE_2010_S8624100/d19-x01-y01","2360", "0" )
 
 logging.info("Processing ALICE_2010_S8625980")
 useOnePt("/ALICE_2010_S8625980/d03-x01-y01", "7000", "0" )
 useOnePt("/ALICE_2010_S8625980/d04-x01-y01",  "900", "0" )
 useOnePt("/ALICE_2010_S8625980/d05-x01-y01", "2360", "0" )
 useOnePt("/ALICE_2010_S8625980/d06-x01-y01", "7000", "0" )
 
 logging.info("Processing ATLAS_2010_S8918562")
 useOnePt("/ATLAS_2010_S8918562/d01-x01-y01",  "900", "0" )
 useOnePt("/ATLAS_2010_S8918562/d02-x01-y01", "2360", "0" )
 useOnePt("/ATLAS_2010_S8918562/d03-x01-y01", "7000", "0" )
 useOnePt("/ATLAS_2010_S8918562/d04-x01-y01",  "900", "0" )
 useOnePt("/ATLAS_2010_S8918562/d05-x01-y01", "7000", "0" )
 useOnePt("/ATLAS_2010_S8918562/d06-x01-y01",  "900", "0" )
 useOnePt("/ATLAS_2010_S8918562/d07-x01-y01", "7000", "0" )
 useOnePt("/ATLAS_2010_S8918562/d08-x01-y01",  "900", "0" )
 useOnePt("/ATLAS_2010_S8918562/d09-x01-y01", "2360", "0" )
 useOnePt("/ATLAS_2010_S8918562/d10-x01-y01", "7000", "0" )
 useOnePt("/ATLAS_2010_S8918562/d11-x01-y01",  "900", "0" )
 useOnePt("/ATLAS_2010_S8918562/d12-x01-y01", "7000", "0" )
 useOnePt("/ATLAS_2010_S8918562/d13-x01-y01",  "900", "0" )
 useOnePt("/ATLAS_2010_S8918562/d14-x01-y01", "7000", "0" )
 useOnePt("/ATLAS_2010_S8918562/d15-x01-y01",  "900", "0" )
 useOnePt("/ATLAS_2010_S8918562/d16-x01-y01", "2360", "0" )
 useOnePt("/ATLAS_2010_S8918562/d17-x01-y01", "7000", "0" )
 
 
 useOnePt("/ATLAS_2010_S8918562/d18-x01-y01",  "900", "0" )
 useOnePt("/ATLAS_2010_S8918562/d19-x01-y01", "7000", "0" )
 useOnePt("/ATLAS_2010_S8918562/d20-x01-y01",  "900", "0" )
 useOnePt("/ATLAS_2010_S8918562/d21-x01-y01", "7000", "0" )
 useOnePt("/ATLAS_2010_S8918562/d22-x01-y01",  "900", "0" )
 useOnePt("/ATLAS_2010_S8918562/d23-x01-y01", "7000", "0" )
 useOnePt("/ATLAS_2010_S8918562/d24-x01-y01",  "900", "0" )
 useOnePt("/ATLAS_2010_S8918562/d25-x01-y01", "7000", "0" )
 useOnePt("/ATLAS_2010_S8918562/d26-x01-y01",  "900", "0" )
 useOnePt("/ATLAS_2010_S8918562/d27-x01-y01", "7000", "0" )
 useOnePt("/ATLAS_2010_S8918562/d28-x01-y01",  "900", "0" )
 useOnePt("/ATLAS_2010_S8918562/d29-x01-y01", "7000", "0" )
 useOnePt("/ATLAS_2010_S8918562/d30-x01-y01",  "900", "0" )
 useOnePt("/ATLAS_2010_S8918562/d31-x01-y01", "7000", "0" )
 useOnePt("/ATLAS_2010_S8918562/d32-x01-y01",  "900", "0" )
 useOnePt("/ATLAS_2010_S8918562/d33-x01-y01", "7000", "0" )
 useOnePt("/ATLAS_2010_S8918562/d34-x01-y01",  "900", "0" )
 useOnePt("/ATLAS_2010_S8918562/d35-x01-y01", "7000", "0" )
 useOnePt("/ATLAS_2010_S8918562/d36-x01-y01",  "900", "0" )
 useOnePt("/ATLAS_2010_S8918562/d37-x01-y01", "7000", "0" )
 useOnePt("/ATLAS_2010_S8918562/d38-x01-y01",  "900", "0" )
 useOnePt("/ATLAS_2010_S8918562/d39-x01-y01", "7000", "0" )
 
 
 
 logging.info("Processing ATLAS_2011_S8971293")
 useOnePt("/ATLAS_2011_S8971293/d01-x01-y01", "7000", "110" )
 useOnePt("/ATLAS_2011_S8971293/d01-x01-y02", "7000", "110" )
 useOnePt("/ATLAS_2011_S8971293/d01-x01-y03", "7000", "210" )
 useOnePt("/ATLAS_2011_S8971293/d01-x01-y04", "7000", "260" )
 useOnePt("/ATLAS_2011_S8971293/d01-x01-y05", "7000", "260" )
 useOnePt("/ATLAS_2011_S8971293/d01-x01-y06", "7000", "400" )
 useOnePt("/ATLAS_2011_S8971293/d01-x01-y07", "7000", "400" )
 useOnePt("/ATLAS_2011_S8971293/d01-x01-y08", "7000", "600" )
 useOnePt("/ATLAS_2011_S8971293/d01-x01-y09", "7000", "600" )
 logging.info("Processing ATLAS_2011_S8924791")
 if( not opts.ue) :
     useOnePt("/ATLAS_2011_S8924791/d01-x01-y01", "7000", "10" )
     useOnePt("/ATLAS_2011_S8924791/d01-x01-y02", "7000", "10" )
     useOnePt("/ATLAS_2011_S8924791/d01-x02-y01", "7000", "10" )
     useOnePt("/ATLAS_2011_S8924791/d01-x02-y02", "7000", "10" )
     useOnePt("/ATLAS_2011_S8924791/d01-x03-y01", "7000", "10" )
     useOnePt("/ATLAS_2011_S8924791/d01-x03-y02", "7000", "10" )
     useOnePt("/ATLAS_2011_S8924791/d01-x04-y01", "7000", "10" )
     useOnePt("/ATLAS_2011_S8924791/d01-x04-y02", "7000", "10" )
     useOnePt("/ATLAS_2011_S8924791/d01-x05-y01", "7000", "10" )
     useOnePt("/ATLAS_2011_S8924791/d01-x05-y02", "7000", "10" )
     useOnePt("/ATLAS_2011_S8924791/d01-x06-y01", "7000", "10" )
     useOnePt("/ATLAS_2011_S8924791/d01-x06-y02", "7000", "10" )
 else :
     useOnePt("/ATLAS_2011_S8924791/d01-x01-y01", "7000", "20" )
     useOnePt("/ATLAS_2011_S8924791/d01-x01-y02", "7000", "20" )
     useOnePt("/ATLAS_2011_S8924791/d01-x02-y01", "7000", "20" )
     useOnePt("/ATLAS_2011_S8924791/d01-x02-y02", "7000", "20" )
     useOnePt("/ATLAS_2011_S8924791/d01-x03-y01", "7000", "20" )
     useOnePt("/ATLAS_2011_S8924791/d01-x03-y02", "7000", "20" )
     useOnePt("/ATLAS_2011_S8924791/d01-x04-y01", "7000", "20" )
     useOnePt("/ATLAS_2011_S8924791/d01-x04-y02", "7000", "20" )
     useOnePt("/ATLAS_2011_S8924791/d01-x05-y01", "7000", "20" )
     useOnePt("/ATLAS_2011_S8924791/d01-x05-y02", "7000", "20" )
     useOnePt("/ATLAS_2011_S8924791/d01-x06-y01", "7000", "20" )
     useOnePt("/ATLAS_2011_S8924791/d01-x06-y02", "7000", "20" )
 
 useOnePt("/ATLAS_2011_S8924791/d02-x01-y01", "7000", "40" )
 useOnePt("/ATLAS_2011_S8924791/d02-x01-y02", "7000", "40" )
 useOnePt("/ATLAS_2011_S8924791/d02-x02-y01", "7000", "40" )
 useOnePt("/ATLAS_2011_S8924791/d02-x02-y02", "7000", "40" )
 useOnePt("/ATLAS_2011_S8924791/d02-x03-y01", "7000", "40" )
 useOnePt("/ATLAS_2011_S8924791/d02-x03-y02", "7000", "40" )
 useOnePt("/ATLAS_2011_S8924791/d02-x04-y01", "7000", "40" )
 useOnePt("/ATLAS_2011_S8924791/d02-x04-y02", "7000", "40" )
 useOnePt("/ATLAS_2011_S8924791/d02-x05-y01", "7000", "40" )
 useOnePt("/ATLAS_2011_S8924791/d02-x05-y02", "7000", "40" )
 useOnePt("/ATLAS_2011_S8924791/d02-x06-y01", "7000", "40" )
 useOnePt("/ATLAS_2011_S8924791/d02-x06-y02", "7000", "40" )
 useOnePt("/ATLAS_2011_S8924791/d03-x01-y01", "7000", "40" )
 useOnePt("/ATLAS_2011_S8924791/d03-x01-y02", "7000", "40" )
 useOnePt("/ATLAS_2011_S8924791/d03-x02-y01", "7000", "40" )
 useOnePt("/ATLAS_2011_S8924791/d03-x02-y02", "7000", "40" )
 useOnePt("/ATLAS_2011_S8924791/d03-x03-y01", "7000", "40" )
 useOnePt("/ATLAS_2011_S8924791/d03-x03-y02", "7000", "40" )
 useOnePt("/ATLAS_2011_S8924791/d03-x04-y01", "7000", "40" )
 useOnePt("/ATLAS_2011_S8924791/d03-x04-y02", "7000", "40" )
 useOnePt("/ATLAS_2011_S8924791/d03-x05-y01", "7000", "40" )
 useOnePt("/ATLAS_2011_S8924791/d03-x05-y02", "7000", "40" )
 useOnePt("/ATLAS_2011_S8924791/d03-x06-y01", "7000", "40" )
 useOnePt("/ATLAS_2011_S8924791/d03-x06-y02", "7000", "40" )
 useOnePt("/ATLAS_2011_S8924791/d04-x01-y01", "7000", "80" )
 useOnePt("/ATLAS_2011_S8924791/d04-x01-y02", "7000", "80" )
 useOnePt("/ATLAS_2011_S8924791/d04-x02-y01", "7000", "80" )
 useOnePt("/ATLAS_2011_S8924791/d04-x02-y02", "7000", "80" )
 useOnePt("/ATLAS_2011_S8924791/d04-x03-y01", "7000", "80" )
 useOnePt("/ATLAS_2011_S8924791/d04-x03-y02", "7000", "80" )
 useOnePt("/ATLAS_2011_S8924791/d04-x04-y01", "7000", "80" )
 useOnePt("/ATLAS_2011_S8924791/d04-x04-y02", "7000", "80" )
 useOnePt("/ATLAS_2011_S8924791/d04-x05-y01", "7000", "80" )
 useOnePt("/ATLAS_2011_S8924791/d04-x05-y02", "7000", "80" )
 useOnePt("/ATLAS_2011_S8924791/d04-x06-y01", "7000", "80" )
 useOnePt("/ATLAS_2011_S8924791/d04-x06-y02", "7000", "80" )
 useOnePt("/ATLAS_2011_S8924791/d05-x01-y01", "7000", "110" )
 useOnePt("/ATLAS_2011_S8924791/d05-x01-y02", "7000", "110" )
 useOnePt("/ATLAS_2011_S8924791/d05-x02-y01", "7000", "110" )
 useOnePt("/ATLAS_2011_S8924791/d05-x02-y02", "7000", "110" )
 useOnePt("/ATLAS_2011_S8924791/d05-x03-y01", "7000", "110" )
 useOnePt("/ATLAS_2011_S8924791/d05-x03-y02", "7000", "110" )
 useOnePt("/ATLAS_2011_S8924791/d05-x04-y01", "7000", "110" )
 useOnePt("/ATLAS_2011_S8924791/d05-x04-y02", "7000", "110" )
 useOnePt("/ATLAS_2011_S8924791/d05-x05-y01", "7000", "110" )
 useOnePt("/ATLAS_2011_S8924791/d05-x05-y02", "7000", "110" )
 useOnePt("/ATLAS_2011_S8924791/d05-x06-y01", "7000", "110" )
 useOnePt("/ATLAS_2011_S8924791/d05-x06-y02", "7000", "110" )
 useOnePt("/ATLAS_2011_S8924791/d06-x01-y01", "7000", "110" )
 useOnePt("/ATLAS_2011_S8924791/d06-x01-y02", "7000", "110" )
 useOnePt("/ATLAS_2011_S8924791/d06-x02-y01", "7000", "110" )
 useOnePt("/ATLAS_2011_S8924791/d06-x02-y02", "7000", "110" )
 useOnePt("/ATLAS_2011_S8924791/d06-x03-y01", "7000", "110" )
 useOnePt("/ATLAS_2011_S8924791/d06-x03-y02", "7000", "110" )
 useOnePt("/ATLAS_2011_S8924791/d06-x04-y01", "7000", "110" )
 useOnePt("/ATLAS_2011_S8924791/d06-x04-y02", "7000", "110" )
 useOnePt("/ATLAS_2011_S8924791/d06-x05-y01", "7000", "110" )
 useOnePt("/ATLAS_2011_S8924791/d06-x05-y02", "7000", "110" )
 useOnePt("/ATLAS_2011_S8924791/d06-x06-y01", "7000", "110" )
 useOnePt("/ATLAS_2011_S8924791/d06-x06-y02", "7000", "110" )
 useOnePt("/ATLAS_2011_S8924791/d07-x01-y01", "7000", "210" )
 useOnePt("/ATLAS_2011_S8924791/d07-x01-y02", "7000", "210" )
 useOnePt("/ATLAS_2011_S8924791/d07-x02-y01", "7000", "210" )
 useOnePt("/ATLAS_2011_S8924791/d07-x02-y02", "7000", "210" )
 useOnePt("/ATLAS_2011_S8924791/d07-x03-y01", "7000", "210" )
 useOnePt("/ATLAS_2011_S8924791/d07-x03-y02", "7000", "210" )
 useOnePt("/ATLAS_2011_S8924791/d07-x04-y01", "7000", "210" )
 useOnePt("/ATLAS_2011_S8924791/d07-x04-y02", "7000", "210" )
 useOnePt("/ATLAS_2011_S8924791/d07-x05-y01", "7000", "210" )
 useOnePt("/ATLAS_2011_S8924791/d07-x05-y02", "7000", "210" )
 useOnePt("/ATLAS_2011_S8924791/d07-x06-y01", "7000", "210" )
 useOnePt("/ATLAS_2011_S8924791/d07-x06-y02", "7000", "210" )
 useOnePt("/ATLAS_2011_S8924791/d08-x01-y01", "7000", "260" )
 useOnePt("/ATLAS_2011_S8924791/d08-x01-y02", "7000", "260" )
 useOnePt("/ATLAS_2011_S8924791/d08-x02-y01", "7000", "260" )
 useOnePt("/ATLAS_2011_S8924791/d08-x02-y02", "7000", "260" )
 useOnePt("/ATLAS_2011_S8924791/d08-x03-y01", "7000", "260" )
 useOnePt("/ATLAS_2011_S8924791/d08-x03-y02", "7000", "260" )
 useOnePt("/ATLAS_2011_S8924791/d08-x04-y01", "7000", "260" )
 useOnePt("/ATLAS_2011_S8924791/d08-x04-y02", "7000", "260" )
 useOnePt("/ATLAS_2011_S8924791/d08-x05-y01", "7000", "260" )
 useOnePt("/ATLAS_2011_S8924791/d08-x05-y02", "7000", "260" )
 useOnePt("/ATLAS_2011_S8924791/d08-x06-y01", "7000", "260" )
 useOnePt("/ATLAS_2011_S8924791/d08-x06-y02", "7000", "260" )
 useOnePt("/ATLAS_2011_S8924791/d09-x01-y01", "7000", "260" )
 useOnePt("/ATLAS_2011_S8924791/d09-x01-y02", "7000", "260" )
 useOnePt("/ATLAS_2011_S8924791/d09-x02-y01", "7000", "260" )
 useOnePt("/ATLAS_2011_S8924791/d09-x02-y02", "7000", "260" )
 useOnePt("/ATLAS_2011_S8924791/d09-x03-y01", "7000", "260" )
 useOnePt("/ATLAS_2011_S8924791/d09-x03-y02", "7000", "260" )
 useOnePt("/ATLAS_2011_S8924791/d09-x04-y01", "7000", "260" )
 useOnePt("/ATLAS_2011_S8924791/d09-x04-y02", "7000", "260" )
 useOnePt("/ATLAS_2011_S8924791/d09-x05-y01", "7000", "260" )
 useOnePt("/ATLAS_2011_S8924791/d09-x05-y02", "7000", "260" )
 useOnePt("/ATLAS_2011_S8924791/d09-x06-y01", "7000", "260" )
 useOnePt("/ATLAS_2011_S8924791/d09-x06-y02", "7000", "260" )
 useOnePt("/ATLAS_2011_S8924791/d10-x01-y01", "7000", "400" )
 useOnePt("/ATLAS_2011_S8924791/d10-x01-y02", "7000", "400" )
 useOnePt("/ATLAS_2011_S8924791/d10-x02-y01", "7000", "400" )
 useOnePt("/ATLAS_2011_S8924791/d10-x02-y02", "7000", "400" )
 useOnePt("/ATLAS_2011_S8924791/d10-x03-y01", "7000", "400" )
 useOnePt("/ATLAS_2011_S8924791/d10-x03-y02", "7000", "400" )
 useOnePt("/ATLAS_2011_S8924791/d10-x04-y01", "7000", "400" )
 useOnePt("/ATLAS_2011_S8924791/d10-x04-y02", "7000", "400" )
 useOnePt("/ATLAS_2011_S8924791/d10-x05-y01", "7000", "400" )
 useOnePt("/ATLAS_2011_S8924791/d10-x05-y02", "7000", "400" )
 useOnePt("/ATLAS_2011_S8924791/d10-x06-y01", "7000", "400" )
 useOnePt("/ATLAS_2011_S8924791/d10-x06-y02", "7000", "400" )
 useOnePt("/ATLAS_2011_S8924791/d11-x01-y01", "7000", "400" )
 useOnePt("/ATLAS_2011_S8924791/d11-x01-y02", "7000", "400" )
 useOnePt("/ATLAS_2011_S8924791/d11-x02-y01", "7000", "400" )
 useOnePt("/ATLAS_2011_S8924791/d11-x02-y02", "7000", "400" )
 useOnePt("/ATLAS_2011_S8924791/d11-x03-y01", "7000", "400" )
 useOnePt("/ATLAS_2011_S8924791/d11-x03-y02", "7000", "400" )
 useOnePt("/ATLAS_2011_S8924791/d11-x04-y01", "7000", "400" )
 useOnePt("/ATLAS_2011_S8924791/d11-x04-y02", "7000", "400" )
 useOnePt("/ATLAS_2011_S8924791/d11-x05-y01", "7000", "400" )
 useOnePt("/ATLAS_2011_S8924791/d11-x05-y02", "7000", "400" )
 useOnePt("/ATLAS_2011_S8924791/d11-x06-y01", "7000", "400" )
 useOnePt("/ATLAS_2011_S8924791/d11-x06-y02", "7000", "400" )
 logging.info("Processing ATLAS_2010_S8817804")
 mergeByPt("/ATLAS_2010_S8817804/d01-x01-y01", "7000")
 mergeByPt("/ATLAS_2010_S8817804/d02-x01-y01", "7000")
 mergeByPt("/ATLAS_2010_S8817804/d03-x01-y01", "7000")
 mergeByPt("/ATLAS_2010_S8817804/d04-x01-y01", "7000")
 mergeByPt("/ATLAS_2010_S8817804/d05-x01-y01", "7000")
 mergeByPt("/ATLAS_2010_S8817804/d06-x01-y01", "7000")
 mergeByPt("/ATLAS_2010_S8817804/d07-x01-y01", "7000")
 mergeByPt("/ATLAS_2010_S8817804/d08-x01-y01", "7000")
 mergeByPt("/ATLAS_2010_S8817804/d09-x01-y01", "7000")
 mergeByPt("/ATLAS_2010_S8817804/d10-x01-y01", "7000")
 
 mergeByMass("/ATLAS_2010_S8817804/d11-x01-y01", "7000")
 mergeByMass("/ATLAS_2010_S8817804/d12-x01-y01", "7000")
 mergeByMass("/ATLAS_2010_S8817804/d13-x01-y01", "7000")
 mergeByMass("/ATLAS_2010_S8817804/d14-x01-y01", "7000")
 mergeByMass("/ATLAS_2010_S8817804/d15-x01-y01", "7000")
 mergeByMass("/ATLAS_2010_S8817804/d16-x01-y01", "7000")
 mergeByMass("/ATLAS_2010_S8817804/d17-x01-y01", "7000")
 mergeByMass("/ATLAS_2010_S8817804/d18-x01-y01", "7000")
 mergeByMass("/ATLAS_2010_S8817804/d19-x01-y01", "7000")
 mergeByMass("/ATLAS_2010_S8817804/d20-x01-y01", "7000")
 
 useOneMass("/ATLAS_2010_S8817804/d21-x01-y01", "7000", "250" )
 useOneMass("/ATLAS_2010_S8817804/d22-x01-y01", "7000", "250" )
 useOneMass("/ATLAS_2010_S8817804/d23-x01-y01", "7000", "650" )
 useOneMass("/ATLAS_2010_S8817804/d24-x01-y01", "7000", "250" )
 useOneMass("/ATLAS_2010_S8817804/d25-x01-y01", "7000", "250" )
 useOneMass("/ATLAS_2010_S8817804/d26-x01-y01", "7000", "650" )
 
 
 logging.info("Processing ATLAS_2011_I930220")
 mergeByPt("/ATLAS_2011_I930220/d01-x01-y01",  "7000" )
 mergeByPt("/ATLAS_2011_I930220/d02-x01-y01",  "7000" )
 mergeByPt("/ATLAS_2011_I930220/d03-x01-y01",  "7000" )
 mergeByPt("/ATLAS_2011_I930220/d04-x01-y01",  "7000" )
 mergeByPt("/ATLAS_2011_I930220/d05-x01-y01",  "7000" )
 mergeByPt("/ATLAS_2011_I930220/d06-x01-y01",  "7000" )
 mergeByMass("/ATLAS_2011_I930220/d07-x01-y01", "7000")
 useOneMass("/ATLAS_2011_I930220/d08-x01-y01", "7000", "110" )
 useOneMass("/ATLAS_2011_I930220/d09-x01-y01", "7000", "110" )
 useOneMass("/ATLAS_2011_I930220/d10-x01-y01", "7000", "370" )
 
 logging.info("Processing ATLAS_2012_I1082936")
 mergeByPt("/ATLAS_2012_I1082936/d01-x01-y01", "7000")
 mergeByPt("/ATLAS_2012_I1082936/d01-x01-y02", "7000")
 mergeByPt("/ATLAS_2012_I1082936/d01-x01-y03", "7000")
 mergeByPt("/ATLAS_2012_I1082936/d01-x01-y04", "7000")
 mergeByPt("/ATLAS_2012_I1082936/d01-x01-y05", "7000")
 mergeByPt("/ATLAS_2012_I1082936/d01-x01-y06", "7000")
 mergeByPt("/ATLAS_2012_I1082936/d01-x01-y07", "7000")
 mergeByPt("/ATLAS_2012_I1082936/d02-x01-y01", "7000")
 mergeByPt("/ATLAS_2012_I1082936/d02-x01-y02", "7000")
 mergeByPt("/ATLAS_2012_I1082936/d02-x01-y03", "7000")
 mergeByPt("/ATLAS_2012_I1082936/d02-x01-y04", "7000")
 mergeByPt("/ATLAS_2012_I1082936/d02-x01-y05", "7000")
 mergeByPt("/ATLAS_2012_I1082936/d02-x01-y06", "7000")
 mergeByPt("/ATLAS_2012_I1082936/d02-x01-y07", "7000")
 
 mergeByMass("/ATLAS_2012_I1082936/d03-x01-y01", "7000", 1000.)
 mergeByMass("/ATLAS_2012_I1082936/d03-x01-y02", "7000", 1000.)
 mergeByMass("/ATLAS_2012_I1082936/d03-x01-y03", "7000", 1000.)
 mergeByMass("/ATLAS_2012_I1082936/d03-x01-y04", "7000", 1000.)
 mergeByMass("/ATLAS_2012_I1082936/d03-x01-y05", "7000", 1000.)
 mergeByMass("/ATLAS_2012_I1082936/d03-x01-y06", "7000", 1000.)
 mergeByMass("/ATLAS_2012_I1082936/d03-x01-y07", "7000", 1000.)
 mergeByMass("/ATLAS_2012_I1082936/d03-x01-y08", "7000", 1000.)
 mergeByMass("/ATLAS_2012_I1082936/d03-x01-y09", "7000", 1000.)
 mergeByMass("/ATLAS_2012_I1082936/d04-x01-y01", "7000", 1000.)
 mergeByMass("/ATLAS_2012_I1082936/d04-x01-y02", "7000", 1000.)
 mergeByMass("/ATLAS_2012_I1082936/d04-x01-y03", "7000", 1000.)
 mergeByMass("/ATLAS_2012_I1082936/d04-x01-y04", "7000", 1000.)
 mergeByMass("/ATLAS_2012_I1082936/d04-x01-y05", "7000", 1000.)
 mergeByMass("/ATLAS_2012_I1082936/d04-x01-y06", "7000", 1000.)
 mergeByMass("/ATLAS_2012_I1082936/d04-x01-y07", "7000", 1000.)
 mergeByMass("/ATLAS_2012_I1082936/d04-x01-y08", "7000", 1000.)
 mergeByMass("/ATLAS_2012_I1082936/d04-x01-y09", "7000", 1000.)
 
 
 logging.info("Processing CMS_2011_S8968497")
 
 useOneMass("/CMS_2011_S8968497/d01-x01-y01", "7000", "1700" )
 useOneMass("/CMS_2011_S8968497/d02-x01-y01", "7000", "1700" )
 useOneMass("/CMS_2011_S8968497/d03-x01-y01", "7000", "1100" )
 useOneMass("/CMS_2011_S8968497/d04-x01-y01", "7000", "1100" )
 useOneMass("/CMS_2011_S8968497/d05-x01-y01", "7000", "650" )
 useOneMass("/CMS_2011_S8968497/d06-x01-y01", "7000", "650" )
 useOneMass("/CMS_2011_S8968497/d07-x01-y01", "7000", "250" )
 useOneMass("/CMS_2011_S8968497/d08-x01-y01", "7000", "250" )
 useOneMass("/CMS_2011_S8968497/d09-x01-y01", "7000", "250" )
 
 
 logging.info("Processing ATLAS_2011_S9126244")
 mergeByPt("/ATLAS_2011_S9126244/d01-x01-y01", "7000")
 mergeByPt("/ATLAS_2011_S9126244/d01-x01-y02", "7000")
 mergeByPt("/ATLAS_2011_S9126244/d02-x01-y01", "7000")
 mergeByPt("/ATLAS_2011_S9126244/d02-x01-y02", "7000")
 mergeByPt("/ATLAS_2011_S9126244/d03-x01-y01", "7000")
 mergeByPt("/ATLAS_2011_S9126244/d03-x01-y02", "7000")
 mergeByPt("/ATLAS_2011_S9126244/d04-x01-y01", "7000")
 mergeByPt("/ATLAS_2011_S9126244/d04-x01-y02", "7000")
 mergeByPt("/ATLAS_2011_S9126244/d05-x01-y01", "7000")
 mergeByPt("/ATLAS_2011_S9126244/d05-x01-y02", "7000")
 
 
 useOnePt("/ATLAS_2011_S9126244/d06-x01-y01", "7000", "40" )
 useOnePt("/ATLAS_2011_S9126244/d06-x01-y02", "7000", "40" )
 useOnePt("/ATLAS_2011_S9126244/d07-x01-y01", "7000", "80" )
 useOnePt("/ATLAS_2011_S9126244/d07-x01-y02", "7000", "80" )
 useOnePt("/ATLAS_2011_S9126244/d08-x01-y01", "7000", "80" )
 useOnePt("/ATLAS_2011_S9126244/d08-x01-y02", "7000", "80" )
 useOnePt("/ATLAS_2011_S9126244/d09-x01-y01", "7000", "110" )
 useOnePt("/ATLAS_2011_S9126244/d09-x01-y02", "7000", "110" )
 useOnePt("/ATLAS_2011_S9126244/d10-x01-y01", "7000", "110" )
 useOnePt("/ATLAS_2011_S9126244/d10-x01-y02", "7000", "110" )
 useOnePt("/ATLAS_2011_S9126244/d11-x01-y01", "7000", "210" )
 useOnePt("/ATLAS_2011_S9126244/d11-x01-y02", "7000", "210" )
 useOnePt("/ATLAS_2011_S9126244/d12-x01-y01", "7000", "210" )
 useOnePt("/ATLAS_2011_S9126244/d12-x01-y02", "7000", "210" )
 useOnePt("/ATLAS_2011_S9126244/d13-x01-y01", "7000", "40" )
 useOnePt("/ATLAS_2011_S9126244/d13-x01-y02", "7000", "40" )
 useOnePt("/ATLAS_2011_S9126244/d14-x01-y01", "7000", "40" )
 useOnePt("/ATLAS_2011_S9126244/d14-x01-y02", "7000", "40" )
 useOnePt("/ATLAS_2011_S9126244/d15-x01-y01", "7000", "110" )
 useOnePt("/ATLAS_2011_S9126244/d15-x01-y02", "7000", "110" )
 useOnePt("/ATLAS_2011_S9126244/d16-x01-y01", "7000", "110" )
 useOnePt("/ATLAS_2011_S9126244/d16-x01-y02", "7000", "110" )
 useOnePt("/ATLAS_2011_S9126244/d17-x01-y01", "7000", "210" )
 useOnePt("/ATLAS_2011_S9126244/d17-x01-y02", "7000", "210" )
 useOnePt("/ATLAS_2011_S9126244/d18-x01-y01", "7000", "210" )
 useOnePt("/ATLAS_2011_S9126244/d18-x01-y02", "7000", "210" )
 useOnePt("/ATLAS_2011_S9126244/d19-x01-y01", "7000", "40" )
 useOnePt("/ATLAS_2011_S9126244/d20-x01-y01", "7000", "80" )
 useOnePt("/ATLAS_2011_S9126244/d21-x01-y01", "7000", "110" )
 useOnePt("/ATLAS_2011_S9126244/d22-x01-y01", "7000", "110" )
 useOnePt("/ATLAS_2011_S9126244/d23-x01-y01", "7000", "110" )
 useOnePt("/ATLAS_2011_S9126244/d24-x01-y01", "7000", "210" )
 useOnePt("/ATLAS_2011_S9126244/d25-x01-y01", "7000", "210" )
 mergeByPt("/ATLAS_2011_S9126244/d26-x01-y01", "7000")
 mergeByPt("/ATLAS_2011_S9126244/d26-x01-y02", "7000")
 mergeByPt("/ATLAS_2011_S9126244/d27-x01-y01", "7000")
 mergeByPt("/ATLAS_2011_S9126244/d27-x01-y02", "7000")
 mergeByPt("/ATLAS_2011_S9126244/d28-x01-y01", "7000")
 mergeByPt("/ATLAS_2011_S9126244/d28-x01-y02", "7000")
 mergeByPt("/ATLAS_2011_S9126244/d29-x01-y01", "7000")
 mergeByPt("/ATLAS_2011_S9126244/d29-x01-y02", "7000")
 useOnePt("/ATLAS_2011_S9126244/d30-x01-y01", "7000", "40" )
 useOnePt("/ATLAS_2011_S9126244/d31-x01-y01", "7000", "80" )
 useOnePt("/ATLAS_2011_S9126244/d32-x01-y01", "7000", "110" )
 useOnePt("/ATLAS_2011_S9126244/d33-x01-y01", "7000", "110" )
 useOnePt("/ATLAS_2011_S9126244/d34-x01-y01", "7000", "110" )
 useOnePt("/ATLAS_2011_S9126244/d35-x01-y01", "7000", "210" )
 useOnePt("/ATLAS_2011_S9126244/d36-x01-y01", "7000", "210" )
 useOnePt("/ATLAS_2011_S9126244/d37-x01-y01", "7000", "40" )
 useOnePt("/ATLAS_2011_S9126244/d37-x01-y02", "7000", "40" )
 useOnePt("/ATLAS_2011_S9126244/d38-x01-y01", "7000", "80" )
 useOnePt("/ATLAS_2011_S9126244/d38-x01-y02", "7000", "80" )
 useOnePt("/ATLAS_2011_S9126244/d39-x01-y01", "7000", "110" )
 useOnePt("/ATLAS_2011_S9126244/d39-x01-y02", "7000", "110" )
 useOnePt("/ATLAS_2011_S9126244/d40-x01-y01", "7000", "110" )
 useOnePt("/ATLAS_2011_S9126244/d40-x01-y02", "7000", "110" )
 useOnePt("/ATLAS_2011_S9126244/d41-x01-y01", "7000", "110" )
 useOnePt("/ATLAS_2011_S9126244/d41-x01-y02", "7000", "110" )
 useOnePt("/ATLAS_2011_S9126244/d42-x01-y01", "7000", "210" )
 useOnePt("/ATLAS_2011_S9126244/d42-x01-y02", "7000", "210" )
 useOnePt("/ATLAS_2011_S9126244/d43-x01-y01", "7000", "210" )
 useOnePt("/ATLAS_2011_S9126244/d43-x01-y02", "7000", "210" )
 
 # CMS_2011_S9120041 UE analysis
 logging.info("Processing CMS_2011_S9120041")
 mergeByPt("/CMS_2011_S9120041/d01-x01-y01", "7000")
 mergeByPt("/CMS_2011_S9120041/d02-x01-y01", "7000")
 if(opts.ue) :
     useOnePt("/CMS_2011_S9120041/d03-x01-y01",  "900", "0" )
     useOnePt("/CMS_2011_S9120041/d04-x01-y01",  "900", "0" )
     useOnePt("/CMS_2011_S9120041/d05-x01-y01", "7000", "0" )
     useOnePt("/CMS_2011_S9120041/d06-x01-y01", "7000", "0" )
     useOnePt("/CMS_2011_S9120041/d07-x01-y01", "7000", "0" )
     useOnePt("/CMS_2011_S9120041/d11-x01-y01",  "900", "0" )
     useOnePt("/CMS_2011_S9120041/d12-x01-y01",  "900", "0" )
     useOnePt("/CMS_2011_S9120041/d13-x01-y01",  "900", "0" )
     useOnePt("/CMS_2011_S9120041/d08-x01-y01", "7000", "20" )
     useOnePt("/CMS_2011_S9120041/d09-x01-y01", "7000", "20" )
     useOnePt("/CMS_2011_S9120041/d10-x01-y01", "7000", "20" )
 else :
     useOnePt("/CMS_2011_S9120041/d08-x01-y01", "7000", "10" )
     useOnePt("/CMS_2011_S9120041/d09-x01-y01", "7000", "10" )
     useOnePt("/CMS_2011_S9120041/d10-x01-y01", "7000", "10" )
 
 # CMS dijet decorrelation
 logging.info("Processing CMS_2011_S8950903")
 useOnePt("/CMS_2011_S8950903/d01-x01-y01", "7000", "80" )
 useOnePt("/CMS_2011_S8950903/d02-x01-y01", "7000", "110" )
 useOnePt("/CMS_2011_S8950903/d03-x01-y01", "7000", "110" )
 useOnePt("/CMS_2011_S8950903/d04-x01-y01", "7000", "210" )
 useOnePt("/CMS_2011_S8950903/d05-x01-y01", "7000", "260" )
 
 # CMS jet cross section
 logging.info("Processing CMS_2011_S9086218")
 mergeByPt("/CMS_2011_S9086218/d01-x01-y01", "7000")
 mergeByPt("/CMS_2011_S9086218/d02-x01-y01", "7000")
 mergeByPt("/CMS_2011_S9086218/d03-x01-y01", "7000")
 mergeByPt("/CMS_2011_S9086218/d04-x01-y01", "7000")
 mergeByPt("/CMS_2011_S9086218/d05-x01-y01", "7000")
 mergeByPt("/CMS_2011_S9086218/d06-x01-y01", "7000")
 
 # CMS 2/3 jet cross section ratio
 logging.info("Processing CMS_2011_S9086218")
 mergeByPt("/CMS_2011_S9088458/d01-x01-y01", "7000",500.)
 
 # ATLAS track jet
 logging.info("Processing ATLAS_2011_I919017")
 for d in range(1,3) :
     for y in range(1,5) :
         mergeByPt("/ATLAS_2011_I919017/d0%s-x01-y0%s" % (d,y), "7000")
         if( opts.ue) :
             for x in range(2,6) :
                 for y in ["01","02","06","07","11","12","16","17","21","22"] :
                     useOnePt("/ATLAS_2011_I919017/d0%s-x0%s-y%s" % (d,x,y),  "7000",  "0" )
                 for y in ["03","04","08","09","13","14","18","19","23","24"] :
                     useOnePt("/ATLAS_2011_I919017/d0%s-x0%s-y%s" % (d,x,y),  "7000",  "4" )
                 for y in range(5,30,5) :
                     useOnePt("/ATLAS_2011_I919017/d0%s-x%02d-y%02d" % (d,x,y) ,  "7000", "20" )
         else :
             for x in range(2,6) :
                 for y in range(5,30,5) :
                     useOnePt("/ATLAS_2011_I919017/d0%s-x%02d-y%02d" % (d,x,y) ,  "7000", "10" )
 
 logging.info("Processing ATLAS_2011_I926145")
 mergeByPt("/ATLAS_2011_I926145/d01-x01-y01", "7000",1.5)
 mergeByPt("/ATLAS_2011_I926145/d02-x01-y01", "7000",1.5)
 mergeByPt("/ATLAS_2011_I926145/d03-x01-y01", "7000",1.5)
 
 logging.info("Processing CMS_2011_S8941262")
 useOnePt("/CMS_2011_S8941262/d01-x01-y01",  "7000", "10" )
 useOnePt("/CMS_2011_S8941262/d03-x01-y01",  "7000", "10" )
 mergeByPt("/CMS_2011_S8941262/d02-x01-y01", "7000",1.5)
 
 logging.info("Processing CMS_2011_S8973270")
 useOnePt("/CMS_2011_S8973270/d01-x01-y01",  "7000", "70" )
 useOnePt("/CMS_2011_S8973270/d02-x01-y01",  "7000", "100" )
 useOnePt("/CMS_2011_S8973270/d03-x01-y01",  "7000", "130" )
 useOnePt("/CMS_2011_S8973270/d04-x01-y01",  "7000", "70" )
 useOnePt("/CMS_2011_S8973270/d05-x01-y01",  "7000", "100" )
 useOnePt("/CMS_2011_S8973270/d06-x01-y01",  "7000", "130" )
 
 logging.info("Processing ATLAS_2012_I1082009")
 useOnePt("/ATLAS_2012_I1082009/d08-x01-y01", "7000", "40" )
 useOnePt("/ATLAS_2012_I1082009/d09-x01-y01", "7000", "40" )
 useOnePt("/ATLAS_2012_I1082009/d10-x01-y01", "7000", "40" )
 useOnePt("/ATLAS_2012_I1082009/d11-x01-y01", "7000", "80" )
 useOnePt("/ATLAS_2012_I1082009/d12-x01-y01", "7000", "80" )
 useOnePt("/ATLAS_2012_I1082009/d13-x01-y01", "7000", "40" )
 
 logging.info("Processing ATLAS_2012_I1118269")
 mergeByPt("/ATLAS_2012_I1118269/d01-x01-y01", "7000")
 useOnePt("/ATLAS_2012_I1118269/d02-x01-y01", "7000", "10" )
 
 logging.info("Processing ATLAS_2012_I1188891")
 mergeByPt("/ATLAS_2012_I1188891/d01-x01-y01", "7000")
 mergeByPt("/ATLAS_2012_I1188891/d02-x01-y01", "7000")
 mergeByPt("/ATLAS_2012_I1188891/d03-x01-y01", "7000")
 mergeByPt("/ATLAS_2012_I1188891/d04-x01-y01", "7000")
 mergeByPt("/ATLAS_2012_I1188891/d05-x01-y01", "7000")
 mergeByPt("/ATLAS_2012_I1188891/d06-x01-y01", "7000")
 
 logging.info("Processing CMS_2012_I1087342")
 mergeByPt("/CMS_2012_I1087342/d01-x01-y01", "7000")
 mergeByPt("/CMS_2012_I1087342/d02-x01-y01", "7000")
 mergeByPt("/CMS_2012_I1087342/d03-x01-y01", "7000")
 logging.info("Processing CMS_2012_PAS_QCD_11_010")
 mergeByPt("/CMS_2012_PAS_QCD_11_010/d01-x01-y01", "7000")
 mergeByPt("/CMS_2012_PAS_QCD_11_010/d02-x01-y01", "7000")
 mergeByPt("/CMS_2012_PAS_QCD_11_010/d03-x01-y01", "7000")
 mergeByPt("/CMS_2012_PAS_QCD_11_010/d04-x01-y01", "7000")
 
 logging.info("Processing ATLAS_2011_S9035664")
 mergeByPt("/ATLAS_2011_S9035664/d11-x01-y01", "7000")
 mergeByPt("/ATLAS_2011_S9035664/d12-x01-y01", "7000")
 mergeByPt("/ATLAS_2011_S9035664/d13-x01-y01", "7000")
 mergeByPt("/ATLAS_2011_S9035664/d14-x01-y01", "7000")
 mergeByPt("/ATLAS_2011_S9035664/d15-x01-y01", "7000")
 mergeByPt("/ATLAS_2011_S9035664/d16-x01-y01", "7000")
 mergeByPt("/ATLAS_2011_S9035664/d17-x01-y01", "7000")
 mergeByPt("/ATLAS_2011_S9035664/d18-x01-y01", "7000")
 mergeByPt("/ATLAS_2011_S9035664/d20-x01-y01", "7000")
 mergeByPt("/ATLAS_2011_S9035664/d21-x01-y01", "7000")
 mergeByPt("/ATLAS_2011_S9035664/d22-x01-y01", "7000")
 mergeByPt("/ATLAS_2011_S9035664/d23-x01-y01", "7000")
 
 logging.info("Processing ATLAS_2012_I1125575")
 mergeByPt("/ATLAS_2012_I1125575/d01-x01-y01", "7000")
 mergeByPt("/ATLAS_2012_I1125575/d01-x01-y02", "7000")
 mergeByPt("/ATLAS_2012_I1125575/d01-x02-y01", "7000")
 mergeByPt("/ATLAS_2012_I1125575/d01-x02-y02", "7000")
 mergeByPt("/ATLAS_2012_I1125575/d01-x03-y01", "7000")
 mergeByPt("/ATLAS_2012_I1125575/d01-x03-y02", "7000")
 mergeByPt("/ATLAS_2012_I1125575/d01-x04-y01", "7000")
 mergeByPt("/ATLAS_2012_I1125575/d01-x04-y02", "7000")
 mergeByPt("/ATLAS_2012_I1125575/d01-x05-y01", "7000")
 mergeByPt("/ATLAS_2012_I1125575/d01-x05-y02", "7000")
 mergeByPt("/ATLAS_2012_I1125575/d02-x01-y01", "7000")
 mergeByPt("/ATLAS_2012_I1125575/d02-x01-y02", "7000")
 mergeByPt("/ATLAS_2012_I1125575/d02-x02-y01", "7000")
 mergeByPt("/ATLAS_2012_I1125575/d02-x02-y02", "7000")
 mergeByPt("/ATLAS_2012_I1125575/d02-x03-y01", "7000")
 mergeByPt("/ATLAS_2012_I1125575/d02-x03-y02", "7000")
 mergeByPt("/ATLAS_2012_I1125575/d02-x04-y01", "7000")
 mergeByPt("/ATLAS_2012_I1125575/d02-x04-y02", "7000")
 mergeByPt("/ATLAS_2012_I1125575/d02-x05-y01", "7000")
 mergeByPt("/ATLAS_2012_I1125575/d02-x05-y02", "7000")
 mergeByPt("/ATLAS_2012_I1125575/d03-x01-y01", "7000")
 mergeByPt("/ATLAS_2012_I1125575/d03-x01-y02", "7000")
 mergeByPt("/ATLAS_2012_I1125575/d03-x02-y01", "7000")
 mergeByPt("/ATLAS_2012_I1125575/d03-x02-y02", "7000")
 mergeByPt("/ATLAS_2012_I1125575/d03-x03-y01", "7000")
 mergeByPt("/ATLAS_2012_I1125575/d03-x03-y02", "7000")
 mergeByPt("/ATLAS_2012_I1125575/d03-x04-y01", "7000")
 mergeByPt("/ATLAS_2012_I1125575/d03-x04-y02", "7000")
 mergeByPt("/ATLAS_2012_I1125575/d03-x05-y01", "7000")
 mergeByPt("/ATLAS_2012_I1125575/d03-x05-y02", "7000")
 for d in range(4,7) :
     for x in range(1,6) :
         if(opts.ue) :
             for y in range(1,9) :
                 useOnePt("/ATLAS_2012_I1125575/d0%s-x0%s-y0%s" % (d,x,y),  "7000", "0" )
             for y in ["09","10","11","12","13","14","15","16"] :
                 useOnePt("/ATLAS_2012_I1125575/d0%s-x0%s-y%s" % (d,x,y),  "7000", "0" )
             for y in range(17,19) :
                 useOnePt("/ATLAS_2012_I1125575/d0%s-x0%s-y%s" % (d,x,y),  "7000", "20" )
         else :
             for y in range(17,19) :
                 useOnePt("/ATLAS_2012_I1125575/d0%s-x0%s-y%s" % (d,x,y),  "7000", "10" )
         for y in range(19,21) :
             useOnePt("/ATLAS_2012_I1125575/d0%s-x0%s-y%s" % (d,x,y),  "7000", "40" )
 
 # ATLAS_2012_I1094564
 useOnePt("/ATLAS_2012_I1094564/d01-x01-y01",  "7000", "210" )
 useOnePt("/ATLAS_2012_I1094564/d02-x01-y01",  "7000", "260" )
 useOnePt("/ATLAS_2012_I1094564/d03-x01-y01",  "7000", "400" )
 useOnePt("/ATLAS_2012_I1094564/d04-x01-y01",  "7000", "400" )
 useOnePt("/ATLAS_2012_I1094564/d05-x01-y01",  "7000", "210" )
 useOnePt("/ATLAS_2012_I1094564/d06-x01-y01",  "7000", "260" )
 useOnePt("/ATLAS_2012_I1094564/d07-x01-y01",  "7000", "400" )
 useOnePt("/ATLAS_2012_I1094564/d08-x01-y01",  "7000", "400" )
 useOnePt("/ATLAS_2012_I1094564/d09-x01-y01",  "7000", "210" )
 useOnePt("/ATLAS_2012_I1094564/d10-x01-y01",  "7000", "260" )
 useOnePt("/ATLAS_2012_I1094564/d11-x01-y01",  "7000", "400" )
 useOnePt("/ATLAS_2012_I1094564/d12-x01-y01",  "7000", "400" )
 useOnePt("/ATLAS_2012_I1094564/d13-x01-y01",  "7000", "210" )
 useOnePt("/ATLAS_2012_I1094564/d14-x01-y01",  "7000", "260" )
 useOnePt("/ATLAS_2012_I1094564/d15-x01-y01",  "7000", "400" )
 useOnePt("/ATLAS_2012_I1094564/d16-x01-y01",  "7000", "400" )
 useOnePt("/ATLAS_2012_I1094564/d17-x01-y01",  "7000", "210" )
 useOnePt("/ATLAS_2012_I1094564/d18-x01-y01",  "7000", "260" )
 useOnePt("/ATLAS_2012_I1094564/d19-x01-y01",  "7000", "400" )
 useOnePt("/ATLAS_2012_I1094564/d20-x01-y01",  "7000", "400" )
 useOnePt("/ATLAS_2012_I1094564/d21-x01-y01",  "7000", "210" )
 useOnePt("/ATLAS_2012_I1094564/d22-x01-y01",  "7000", "260" )
 useOnePt("/ATLAS_2012_I1094564/d23-x01-y01",  "7000", "400" )
 useOnePt("/ATLAS_2012_I1094564/d24-x01-y01",  "7000", "400" )
 useOnePt("/ATLAS_2012_I1094564/d25-x01-y01",  "7000", "210" )
 useOnePt("/ATLAS_2012_I1094564/d26-x01-y01",  "7000", "260" )
 useOnePt("/ATLAS_2012_I1094564/d27-x01-y01",  "7000", "400" )
 useOnePt("/ATLAS_2012_I1094564/d28-x01-y01",  "7000", "400" )
 useOnePt("/ATLAS_2012_I1094564/d29-x01-y01",  "7000", "210" )
 useOnePt("/ATLAS_2012_I1094564/d30-x01-y01",  "7000", "260" )
 useOnePt("/ATLAS_2012_I1094564/d31-x01-y01",  "7000", "400" )
 useOnePt("/ATLAS_2012_I1094564/d32-x01-y01",  "7000", "400" )
 useOnePt("/ATLAS_2012_I1094564/d33-x01-y01",  "7000", "210" )
 useOnePt("/ATLAS_2012_I1094564/d34-x01-y01",  "7000", "260" )
 useOnePt("/ATLAS_2012_I1094564/d35-x01-y01",  "7000", "400" )
 useOnePt("/ATLAS_2012_I1094564/d36-x01-y01",  "7000", "400" )
 
 logging.info("Processing CMS_2013_I1224539_DIJET")
 useOnePt("/CMS_2013_I1224539_DIJET/d01-x01-y01",  "7000", "210" )
 useOnePt("/CMS_2013_I1224539_DIJET/d02-x01-y01",  "7000", "260" )
 useOnePt("/CMS_2013_I1224539_DIJET/d03-x01-y01",  "7000", "400" )
 useOnePt("/CMS_2013_I1224539_DIJET/d04-x01-y01",  "7000", "400" )
 useOnePt("/CMS_2013_I1224539_DIJET/d05-x01-y01",  "7000", "600" )
 useOnePt("/CMS_2013_I1224539_DIJET/d06-x01-y01",  "7000", "600" )
 useOnePt("/CMS_2013_I1224539_DIJET/d07-x01-y01",  "7000", "600" )
 useOnePt("/CMS_2013_I1224539_DIJET/d08-x01-y01",  "7000", "210" )
 useOnePt("/CMS_2013_I1224539_DIJET/d09-x01-y01",  "7000", "260" )
 useOnePt("/CMS_2013_I1224539_DIJET/d10-x01-y01",  "7000", "400" )
 useOnePt("/CMS_2013_I1224539_DIJET/d11-x01-y01",  "7000", "400" )
 useOnePt("/CMS_2013_I1224539_DIJET/d12-x01-y01",  "7000", "600" )
 useOnePt("/CMS_2013_I1224539_DIJET/d13-x01-y01",  "7000", "600" )
 useOnePt("/CMS_2013_I1224539_DIJET/d14-x01-y01",  "7000", "600" )
 useOnePt("/CMS_2013_I1224539_DIJET/d15-x01-y01",  "7000", "210" )
 useOnePt("/CMS_2013_I1224539_DIJET/d16-x01-y01",  "7000", "260" )
 useOnePt("/CMS_2013_I1224539_DIJET/d17-x01-y01",  "7000", "400" )
 useOnePt("/CMS_2013_I1224539_DIJET/d18-x01-y01",  "7000", "400" )
 useOnePt("/CMS_2013_I1224539_DIJET/d19-x01-y01",  "7000", "600" )
 useOnePt("/CMS_2013_I1224539_DIJET/d20-x01-y01",  "7000", "600" )
 useOnePt("/CMS_2013_I1224539_DIJET/d21-x01-y01",  "7000", "600" )
 useOnePt("/CMS_2013_I1224539_DIJET/d22-x01-y01",  "7000", "210" )
 useOnePt("/CMS_2013_I1224539_DIJET/d23-x01-y01",  "7000", "260" )
 useOnePt("/CMS_2013_I1224539_DIJET/d24-x01-y01",  "7000", "400" )
 useOnePt("/CMS_2013_I1224539_DIJET/d25-x01-y01",  "7000", "600" )
 useOnePt("/CMS_2013_I1224539_DIJET/d26-x01-y01",  "7000", "600" )
 useOnePt("/CMS_2013_I1224539_DIJET/d27-x01-y01",  "7000", "600" )
 useOnePt("/CMS_2013_I1224539_DIJET/d28-x01-y01",  "7000", "600" )
 
 useOnePt("/CMS_2013_I1273574/d01-x01-y01",  "7000", "80" )
 mergeByPt("/CMS_2013_I1273574/d02-x01-y01", "7000",1.)
 useOnePt("/CMS_2013_I1273574/d03-x01-y01",  "7000", "80" )
 useOnePt("/CMS_2013_I1273574/d04-x01-y01",  "7000", "80" )
 useOnePt("/CMS_2013_I1273574/d05-x01-y01",  "7000", "80" )
 useOnePt("/CMS_2013_I1273574/d06-x01-y01",  "7000", "80" )
 mergeByPt("/CMS_2013_I1273574/d07-x01-y01", "7000",1.)
 useOnePt("/CMS_2013_I1273574/d08-x01-y01",  "7000", "80" )
 mergeByPt("/CMS_2013_I1273574/d09-x01-y01", "7000",1.)
 useOnePt("/CMS_2013_I1273574/d10-x01-y01",  "7000", "80" )
 mergeByPt("/CMS_2013_I1273574/d11-x01-y01", "7000",1.)
 
 useOnePt("/CMS_2013_I1261026/d01-x01-y01",  "7000", "0" )
 useOnePt("/CMS_2013_I1261026/d02-x01-y01",  "7000", "0" )
 useOnePt("/CMS_2013_I1261026/d03-x01-y01",  "7000", "0" )
 useOnePt("/CMS_2013_I1261026/d04-x01-y01",  "7000", "0" )
 useOnePt("/CMS_2013_I1261026/d05-x01-y01",  "7000", "0" )
 useOnePt("/CMS_2013_I1261026/d06-x01-y01",  "7000", "0" )
 useOnePt("/CMS_2013_I1261026/d07-x01-y01",  "7000", "0" )
 useOnePt("/CMS_2013_I1261026/d08-x01-y01",  "7000", "0" )
 useOnePt("/CMS_2013_I1261026/d09-x01-y01",  "7000", "0" )
 useOnePt("/CMS_2013_I1261026/d10-x01-y01",  "7000", "0" )
 useOnePt("/CMS_2013_I1261026/d11-x01-y01",  "7000", "0" )
 useOnePt("/CMS_2013_I1261026/d12-x01-y01",  "7000", "0" )
 useOnePt("/CMS_2013_I1261026/d13-x01-y01",  "7000", "0" )
 useOnePt("/CMS_2013_I1261026/d14-x01-y01",  "7000", "0" )
 useOnePt("/CMS_2013_I1261026/d15-x01-y01",  "7000", "0" )
 useOnePt("/CMS_2013_I1261026/d16-x01-y01",  "7000", "0" )
 useOnePt("/CMS_2013_I1261026/d17-x01-y01",  "7000", "0" )
 
 
 logging.info("Processing CMS_2012_I1090423")
 useOneMass("/CMS_2012_I1090423/d01-x01-y01", "7000", "2900" )
 useOneMass("/CMS_2012_I1090423/d02-x01-y01", "7000", "2300" )
 useOneMass("/CMS_2012_I1090423/d03-x01-y01", "7000", "1700" )
 useOneMass("/CMS_2012_I1090423/d04-x01-y01", "7000", "1100" )
 useOneMass("/CMS_2012_I1090423/d05-x01-y01", "7000", "1100" )
 useOneMass("/CMS_2012_I1090423/d06-x01-y01", "7000", "650" )
 useOneMass("/CMS_2012_I1090423/d07-x01-y01", "7000", "650" )
 useOneMass("/CMS_2012_I1090423/d08-x01-y01", "7000", "250" )
 useOneMass("/CMS_2012_I1090423/d09-x01-y01", "7000", "250" )
 
 
 logging.info("Processing ATLAS_2014_I1298811")
 mergeByPt("/ATLAS_2014_I1298811/d01-x01-y01", "7000")
 mergeByPt("/ATLAS_2014_I1298811/d01-x01-y02", "7000")
 mergeByPt("/ATLAS_2014_I1298811/d02-x01-y01", "7000")
 mergeByPt("/ATLAS_2014_I1298811/d02-x01-y02", "7000")
 mergeByPt("/ATLAS_2014_I1298811/d03-x01-y01", "7000")
 mergeByPt("/ATLAS_2014_I1298811/d03-x01-y02", "7000")
 mergeByPt("/ATLAS_2014_I1298811/d04-x01-y01", "7000")
 mergeByPt("/ATLAS_2014_I1298811/d04-x01-y02", "7000")
 mergeByPt("/ATLAS_2014_I1298811/d05-x01-y01", "7000")
 mergeByPt("/ATLAS_2014_I1298811/d05-x01-y02", "7000")
 mergeByPt("/ATLAS_2014_I1298811/d06-x01-y01", "7000")
 mergeByPt("/ATLAS_2014_I1298811/d06-x01-y02", "7000")
 mergeByPt("/ATLAS_2014_I1298811/d07-x01-y01", "7000")
 mergeByPt("/ATLAS_2014_I1298811/d07-x01-y02", "7000")
 mergeByPt("/ATLAS_2014_I1298811/d08-x01-y01", "7000")
 mergeByPt("/ATLAS_2014_I1298811/d08-x01-y02", "7000")
 mergeByPt("/ATLAS_2014_I1298811/d09-x01-y01", "7000")
 mergeByPt("/ATLAS_2014_I1298811/d09-x01-y02", "7000")
 mergeByPt("/ATLAS_2014_I1298811/d10-x01-y01", "7000")
 mergeByPt("/ATLAS_2014_I1298811/d10-x01-y02", "7000")
 useOnePt("/ATLAS_2014_I1298811/d11-x01-y01",  "7000", "0" )
 useOnePt("/ATLAS_2014_I1298811/d12-x01-y01",  "7000", "0" )
 
 useOnePt("/ATLAS_2014_I1298811/d13-x01-y01",  "7000", "4" )
 useOnePt("/ATLAS_2014_I1298811/d13-x01-y02",  "7000", "4" )
 useOnePt("/ATLAS_2014_I1298811/d14-x01-y01",  "7000", "4" )
 useOnePt("/ATLAS_2014_I1298811/d14-x01-y02",  "7000", "4" )
 useOnePt("/ATLAS_2014_I1298811/d15-x01-y01",  "7000", "4" )
 useOnePt("/ATLAS_2014_I1298811/d15-x01-y02",  "7000", "4" )
 useOnePt("/ATLAS_2014_I1298811/d25-x01-y01",  "7000", "4" )
 useOnePt("/ATLAS_2014_I1298811/d25-x01-y02",  "7000", "4" )
 useOnePt("/ATLAS_2014_I1298811/d26-x01-y01",  "7000", "4" )
 useOnePt("/ATLAS_2014_I1298811/d26-x01-y02",  "7000", "4" )
 useOnePt("/ATLAS_2014_I1298811/d27-x01-y01",  "7000", "4" )
 useOnePt("/ATLAS_2014_I1298811/d27-x01-y02",  "7000", "4" )
 
 useOnePt("/ATLAS_2014_I1298811/d16-x01-y01",  "7000", "4" )
 useOnePt("/ATLAS_2014_I1298811/d16-x01-y02",  "7000", "4" )
 useOnePt("/ATLAS_2014_I1298811/d17-x01-y01",  "7000", "4" )
 useOnePt("/ATLAS_2014_I1298811/d17-x01-y02",  "7000", "4" )
 useOnePt("/ATLAS_2014_I1298811/d18-x01-y01",  "7000", "4" )
 useOnePt("/ATLAS_2014_I1298811/d18-x01-y02",  "7000", "4" )
 useOnePt("/ATLAS_2014_I1298811/d28-x01-y01",  "7000", "4" )
 useOnePt("/ATLAS_2014_I1298811/d28-x01-y02",  "7000", "4" )
 useOnePt("/ATLAS_2014_I1298811/d29-x01-y01",  "7000", "4" )
 useOnePt("/ATLAS_2014_I1298811/d29-x01-y02",  "7000", "4" )
 useOnePt("/ATLAS_2014_I1298811/d30-x01-y01",  "7000", "4" )
 useOnePt("/ATLAS_2014_I1298811/d30-x01-y02",  "7000", "4" )
 
 useOnePt("/ATLAS_2014_I1298811/d19-x01-y01",  "7000", "40" )
 useOnePt("/ATLAS_2014_I1298811/d19-x01-y02",  "7000", "40" )
 useOnePt("/ATLAS_2014_I1298811/d20-x01-y01",  "7000", "40" )
 useOnePt("/ATLAS_2014_I1298811/d20-x01-y02",  "7000", "40" )
 useOnePt("/ATLAS_2014_I1298811/d21-x01-y01",  "7000", "40" )
 useOnePt("/ATLAS_2014_I1298811/d21-x01-y02",  "7000", "40" )
 useOnePt("/ATLAS_2014_I1298811/d31-x01-y01",  "7000", "40" )
 useOnePt("/ATLAS_2014_I1298811/d31-x01-y02",  "7000", "40" )
 useOnePt("/ATLAS_2014_I1298811/d32-x01-y01",  "7000", "40" )
 useOnePt("/ATLAS_2014_I1298811/d32-x01-y02",  "7000", "40" )
 useOnePt("/ATLAS_2014_I1298811/d33-x01-y01",  "7000", "40" )
 useOnePt("/ATLAS_2014_I1298811/d33-x01-y02",  "7000", "40" )
 
 useOnePt("/ATLAS_2014_I1298811/d22-x01-y01",  "7000", "210" )
 useOnePt("/ATLAS_2014_I1298811/d22-x01-y02",  "7000", "210" )
 useOnePt("/ATLAS_2014_I1298811/d23-x01-y01",  "7000", "210" )
 useOnePt("/ATLAS_2014_I1298811/d23-x01-y02",  "7000", "210" )
 useOnePt("/ATLAS_2014_I1298811/d24-x01-y01",  "7000", "210" )
 useOnePt("/ATLAS_2014_I1298811/d24-x01-y02",  "7000", "210" )
 useOnePt("/ATLAS_2014_I1298811/d34-x01-y01",  "7000", "210" )
 useOnePt("/ATLAS_2014_I1298811/d34-x01-y02",  "7000", "210" )
 useOnePt("/ATLAS_2014_I1298811/d35-x01-y01",  "7000", "210" )
 useOnePt("/ATLAS_2014_I1298811/d35-x01-y02",  "7000", "210" )
 useOnePt("/ATLAS_2014_I1298811/d36-x01-y01",  "7000", "210" )
 useOnePt("/ATLAS_2014_I1298811/d36-x01-y02",  "7000", "210" )
 
 
 logging.info("Processing ATLAS_2014_I1268975")
 mergeByMass("/ATLAS_2014_I1268975/d01-x01-y01", "7000", 1000.)
 mergeByMass("/ATLAS_2014_I1268975/d01-x01-y02", "7000", 1000.)
 mergeByMass("/ATLAS_2014_I1268975/d01-x01-y03", "7000", 1000.)
 mergeByMass("/ATLAS_2014_I1268975/d01-x01-y04", "7000", 1000.)
 mergeByMass("/ATLAS_2014_I1268975/d01-x01-y05", "7000", 1000.)
 mergeByMass("/ATLAS_2014_I1268975/d01-x01-y06", "7000", 1000.)
 
 mergeByMass("/ATLAS_2014_I1268975/d02-x01-y01", "7000", 1000.)
 mergeByMass("/ATLAS_2014_I1268975/d02-x01-y02", "7000", 1000.)
 mergeByMass("/ATLAS_2014_I1268975/d02-x01-y03", "7000", 1000.)
 mergeByMass("/ATLAS_2014_I1268975/d02-x01-y04", "7000", 1000.)
 mergeByMass("/ATLAS_2014_I1268975/d02-x01-y05", "7000", 1000.)
 mergeByMass("/ATLAS_2014_I1268975/d02-x01-y06", "7000", 1000.)
 
 logging.info("Processing ATLAS_2014_I1307243")
 useOnePt( "/ATLAS_2014_I1307243/d01-x01-y01",  "7000", "80" )
 mergeByPt("/ATLAS_2014_I1307243/d02-x01-y01", "7000")
 useOnePt( "/ATLAS_2014_I1307243/d03-x01-y01",  "7000", "80" )
 mergeByPt("/ATLAS_2014_I1307243/d04-x01-y01", "7000")
 useOnePt( "/ATLAS_2014_I1307243/d05-x01-y01",  "7000", "80" )
 mergeByPt("/ATLAS_2014_I1307243/d06-x01-y01", "7000")
 useOnePt( "/ATLAS_2014_I1307243/d07-x01-y01",  "7000", "80" )
 mergeByPt("/ATLAS_2014_I1307243/d08-x01-y01", "7000")
 useOnePt( "/ATLAS_2014_I1307243/d09-x01-y01",  "7000", "80" )
 mergeByPt("/ATLAS_2014_I1307243/d10-x01-y01", "7000")
 useOnePt( "/ATLAS_2014_I1307243/d11-x01-y01",  "7000", "80" )
 mergeByPt("/ATLAS_2014_I1307243/d12-x01-y01", "7000")
 useOnePt( "/ATLAS_2014_I1307243/d13-x01-y01",  "7000", "80" )
 useOnePt( "/ATLAS_2014_I1307243/d14-x01-y01",  "7000", "80" )
 useOnePt( "/ATLAS_2014_I1307243/d15-x01-y01",  "7000", "80" )
 useOnePt( "/ATLAS_2014_I1307243/d16-x01-y01",  "7000", "80" )
 useOnePt( "/ATLAS_2014_I1307243/d17-x01-y01",  "7000", "80" )
 useOnePt( "/ATLAS_2014_I1307243/d18-x01-y01",  "7000", "80" )
 useOnePt( "/ATLAS_2014_I1307243/d19-x01-y01",  "7000", "80" )
 useOnePt( "/ATLAS_2014_I1307243/d20-x01-y01",  "7000", "80" )
 useOnePt( "/ATLAS_2014_I1307243/d21-x01-y01",  "7000", "80" )
 useOnePt( "/ATLAS_2014_I1307243/d22-x01-y01",  "7000", "80" )
 useOnePt( "/ATLAS_2014_I1307243/d23-x01-y01",  "7000", "80" )
 useOnePt( "/ATLAS_2014_I1307243/d24-x01-y01",  "7000", "80" )
 useOnePt( "/ATLAS_2014_I1307243/d25-x01-y01",  "7000", "80" )
 useOnePt( "/ATLAS_2014_I1307243/d26-x01-y01",  "7000", "80" )
 useOnePt( "/ATLAS_2014_I1307243/d27-x01-y01",  "7000", "80" )
 useOnePt( "/ATLAS_2014_I1307243/d28-x01-y01",  "7000", "80" )
 useOnePt( "/ATLAS_2014_I1307243/d29-x01-y01",  "7000", "80" )
 useOnePt( "/ATLAS_2014_I1307243/d30-x01-y01",  "7000", "80" )
 useOnePt( "/ATLAS_2014_I1307243/d31-x01-y01",  "7000", "80" )
 useOnePt( "/ATLAS_2014_I1307243/d32-x01-y01",  "7000", "80" )
 useOnePt( "/ATLAS_2014_I1307243/d33-x01-y01",  "7000", "80" )
 useOnePt( "/ATLAS_2014_I1307243/d34-x01-y01",  "7000", "80" )
 useOnePt( "/ATLAS_2014_I1307243/d35-x01-y01",  "7000", "80" )
 useOnePt( "/ATLAS_2014_I1307243/d36-x01-y01",  "7000", "80" )
 useOnePt( "/ATLAS_2014_I1307243/d37-x01-y01",  "7000", "80" )
 mergeByPt("/ATLAS_2014_I1307243/d38-x01-y01", "7000")
 useOnePt( "/ATLAS_2014_I1307243/d39-x01-y01",  "7000", "80" )
 mergeByPt("/ATLAS_2014_I1307243/d40-x01-y01", "7000")
 
 
 logging.info("Processing ATLAS_2014_I1325553")
 mergeByPt("/ATLAS_2014_I1325553/d01-x01-y01", "7000")
 mergeByPt("/ATLAS_2014_I1325553/d02-x01-y01", "7000")
 mergeByPt("/ATLAS_2014_I1325553/d03-x01-y01", "7000")
 mergeByPt("/ATLAS_2014_I1325553/d04-x01-y01", "7000")
 mergeByPt("/ATLAS_2014_I1325553/d05-x01-y01", "7000")
 mergeByPt("/ATLAS_2014_I1325553/d06-x01-y01", "7000")
 mergeByPt("/ATLAS_2014_I1325553/d07-x01-y01", "7000")
 mergeByPt("/ATLAS_2014_I1325553/d08-x01-y01", "7000")
 mergeByPt("/ATLAS_2014_I1325553/d09-x01-y01", "7000")
 mergeByPt("/ATLAS_2014_I1325553/d10-x01-y01", "7000")
 mergeByPt("/ATLAS_2014_I1325553/d11-x01-y01", "7000")
 mergeByPt("/ATLAS_2014_I1325553/d12-x01-y01", "7000")
 
 logging.info("Processing ATLAS_2016_I1419070")
 for i in range(1,13) :
     if(i<10) :
         mergeByPt("/ATLAS_2016_I1419070/d0%s-x01-y01" % i, "8000")
     else :
         mergeByPt("/ATLAS_2016_I1419070/d%s-x01-y01"  % i, "8000")
 
 # remake differences and sums
 for ihist in range(1,4) :
     if not ("/ATLAS_2016_I1419070/d0%s-x01-y01" % ihist) in outhistos :
         continue
     h1 = outhistos["/ATLAS_2016_I1419070/d0%s-x01-y01" % ihist  ]
     h2 = outhistos["/ATLAS_2016_I1419070/d0%s-x01-y01" % (ihist+3)]
     sstring = "/ATLAS_2016_I1419070/d%s-x01-y01"  % (9+ihist)
     dstring = "/ATLAS_2016_I1419070/d0%s-x01-y01" % (6+ihist)
     hdiff = yoda.Scatter2D(dstring,dstring)
     hsum  = yoda.Scatter2D(sstring,sstring)
     outhistos[dstring]= hdiff
     outhistos[sstring]= hsum
     for nbin in range(0,h2.numBins()) :
         bsum  = h1.bins()[nbin]+h2.bins()[nbin]
         try:
           ydiff = h2.bins()[nbin].mean()-h1.bins()[nbin].mean()
         except:
           ydiff = 0
         try:
           ysum  = bsum.mean()
           bstderr = bsum.stdErr()
         except:
           ysum  = 0
           bstderr = 0
         try:
           yerr  = math.sqrt(h1.bins()[nbin].stdErr()**2+h2.bins()[nbin].stdErr()**2)
         except:
           yerr  = 0
         x    = h1.bins()[nbin].xMid()
         xerr = 0.5*h1.bins()[nbin].xWidth()
         hdiff.addPoint(x,ydiff,xerr,yerr)
         hsum.addPoint(x,ysum ,xerr,bstderr)
 
 logging.info("Processing ATLAS_2015_I1394679")
 for i in range(1,5) :
     mergeByPt("/ATLAS_2015_I1394679/d0%s-x01-y01" % i, "8000")
 for i in range(5,11) :
     if(i<10) :
         useOnePt( "/ATLAS_2015_I1394679/d0%s-x01-y01" % i,  "8000", "110" )
     else :
         useOnePt( "/ATLAS_2015_I1394679/d%s-x01-y01" % i,  "8000", "110" )
 
 for i in range(0,4) :
     useOnePt( "/ATLAS_2015_I1394679/d%s-x01-y01" % (11+4*i),  "8000", "110" )
     useOnePt( "/ATLAS_2015_I1394679/d%s-x01-y01" % (12+4*i),  "8000", "260" )
     useOnePt( "/ATLAS_2015_I1394679/d%s-x01-y01" % (13+4*i),  "8000", "600" )
     useOnePt( "/ATLAS_2015_I1394679/d%s-x01-y01" % (14+4*i),  "8000", "900" )
 
 for i in range(0,5) :
     useOnePt( "/ATLAS_2015_I1394679/d%s-x01-y01" % (27+4*i),  "8000", "110" )
     useOnePt( "/ATLAS_2015_I1394679/d%s-x01-y01" % (28+4*i),  "8000", "260" )
     useOnePt( "/ATLAS_2015_I1394679/d%s-x01-y01" % (29+4*i),  "8000", "400" )
     useOnePt( "/ATLAS_2015_I1394679/d%s-x01-y01" % (30+4*i),  "8000", "400" )
 
 logging.info("Processing CMS_2013_I1208923")
 for i in range(1,6) :
     mergeByPt  ("/CMS_2013_I1208923/d01-x01-y0%s" % i, "7000")
     mergeByMass("/CMS_2013_I1208923/d02-x01-y0%s" % i, "7000", 1.)
 
 logging.info("Processing CMS_2014_I1298810")
 for i in range(1,19) :
     if(i<10) :
         mergeByPt("/CMS_2014_I1298810/d0"+str(i)+"-x01-y01", "7000")
     else :
         mergeByPt("/CMS_2014_I1298810/d"+str(i)+"-x01-y01", "7000")
 
 logging.info("Processing CMS_2014_I1305624")
 for x in range(1,6) :
     useOnePt( "/CMS_2014_I1305624/d01-x%02d-y01" % x,  "7000", "110" )
     useOnePt( "/CMS_2014_I1305624/d01-x%02d-y02" % x,  "7000", "110" )
     useOnePt( "/CMS_2014_I1305624/d01-x%02d-y03" % x,  "7000", "260" )
     useOnePt( "/CMS_2014_I1305624/d01-x%02d-y04" % x,  "7000", "260" )
     useOnePt( "/CMS_2014_I1305624/d01-x%02d-y05" % x,  "7000", "400" )
 
 logging.info("Processing ATLAS_2011_I929691")
 
 for x in range(0,3) :
     useOnePt( "/ATLAS_2011_I929691/d%02d-x01-y01" % (10*x+ 1),  "7000", "20" )
     useOnePt( "/ATLAS_2011_I929691/d%02d-x01-y01" % (10*x+ 2),  "7000", "40" )
     useOnePt( "/ATLAS_2011_I929691/d%02d-x01-y01" % (10*x+ 3),  "7000", "40" )
     useOnePt( "/ATLAS_2011_I929691/d%02d-x01-y01" % (10*x+ 4),  "7000", "80" )
     useOnePt( "/ATLAS_2011_I929691/d%02d-x01-y01" % (10*x+ 5),  "7000", "110" )
     useOnePt( "/ATLAS_2011_I929691/d%02d-x01-y01" % (10*x+ 6),  "7000", "110" )
     useOnePt( "/ATLAS_2011_I929691/d%02d-x01-y01" % (10*x+ 7),  "7000", "210" )
     useOnePt( "/ATLAS_2011_I929691/d%02d-x01-y01" % (10*x+ 8),  "7000", "260" )
     useOnePt( "/ATLAS_2011_I929691/d%02d-x01-y01" % (10*x+ 9),  "7000", "260" )
     useOnePt( "/ATLAS_2011_I929691/d%02d-x01-y01" % (10*x+10),  "7000", "400" )
 
 logging.info("Processing ATLAS_2015_I1393758")
 for i in range(1,13) :
     mergeByPt("/ATLAS_2015_I1393758/d%02d-x01-y01" % i, "8000")
 
 logging.info("Processing CMS_2016_I1459051")
 for i in range(1,15) :
     mergeByPt("/CMS_2016_I1459051/d%02d-x01-y01" % i, "13000")
     
 logging.info("Processing ATLAS_2016_CONF_2016_092")
 for i in range(1,7) :
     mergeByPt("/ATLAS_2016_CONF_2016_092/d%02d-x01-y01" % i, "13000")
     
 logging.info("Processing ATLAS_2017_I1609253")
 useOnePt( "/ATLAS_2017_I1609253/d01-x01-y01",  "8000", "260" )
 useOnePt( "/ATLAS_2017_I1609253/d02-x01-y01",  "8000", "260" )
 useOnePt( "/ATLAS_2017_I1609253/d03-x01-y01",  "8000", "260" )
 useOnePt( "/ATLAS_2017_I1609253/d04-x01-y01",  "8000", "260" )
 useOnePt( "/ATLAS_2017_I1609253/d05-x01-y01",  "8000", "400" )
 useOnePt( "/ATLAS_2017_I1609253/d06-x01-y01",  "8000", "400" )
 useOnePt( "/ATLAS_2017_I1609253/d07-x01-y01",  "8000", "400" )
 useOnePt( "/ATLAS_2017_I1609253/d08-x01-y01",  "8000", "400" )
 useOnePt( "/ATLAS_2017_I1609253/d09-x01-y01",  "8000", "400" )
 useOnePt( "/ATLAS_2017_I1609253/d10-x01-y01",  "8000", "400" )
 useOnePt( "/ATLAS_2017_I1609253/d11-x01-y01",  "8000", "600" )
 useOnePt( "/ATLAS_2017_I1609253/d12-x01-y01",  "8000", "600" )
 
 logging.info("Processing CMS_2016_I1487277")
 mergeByPt("/CMS_2016_I1487277/d01-x01-y01", "8000")
 mergeByPt("/CMS_2016_I1487277/d02-x01-y01", "8000")
 mergeByPt("/CMS_2016_I1487277/d03-x01-y01", "8000")
 mergeByPt("/CMS_2016_I1487277/d04-x01-y01", "8000")
 mergeByPt("/CMS_2016_I1487277/d05-x01-y01", "8000")
 mergeByPt("/CMS_2016_I1487277/d06-x01-y01", "8000")
 mergeByPt("/CMS_2016_I1487277/d07-x01-y01", "8000")
 
 logging.info("Processing CMS_2016_I1421646")
 useOnePt( "/CMS_2016_I1421646/d01-x01-y01",  "8000", "210" )
 useOnePt( "/CMS_2016_I1421646/d02-x01-y01",  "8000", "260" )
 useOnePt( "/CMS_2016_I1421646/d03-x01-y01",  "8000", "400" )
 useOnePt( "/CMS_2016_I1421646/d04-x01-y01",  "8000", "400" )
 useOnePt( "/CMS_2016_I1421646/d05-x01-y01",  "8000", "600" )
 useOnePt( "/CMS_2016_I1421646/d06-x01-y01",  "8000", "900" )
 useOnePt( "/CMS_2016_I1421646/d07-x01-y01",  "8000", "900" )
 
 
 logging.info("Processing CMS_2017_I1605749")
 for i in [1,2,3,4,5,6,7,8,9,10,13,16] :
     useOnePt("/CMS_2017_I1605749/d%02d-x01-y01" % i, "8000", "400" )
 for i in [11,14,17]:
     useOnePt("/CMS_2017_I1605749/d%02d-x01-y01" % i, "8000", "600" )
 for i in [12,15,18]:
     useOnePt("/CMS_2017_I1605749/d%02d-x01-y01" % i, "8000", "900" )
 
 def CMS_2012_I1111014_name(i,j) :
     if(i+j<100) :
         return "/CMS_2012_I1111014/d%02d-x01-y01" % (i+j)
     else :
         return "/CMS_2012_I1111014/d%03d-x01-y01" % (i+j)
 
 logging.info("Processing CMS_2012_I1111014")
 for j in [0,22,44,66,87,106]:
     for i in [1,2,3] :
         useOnePt(CMS_2012_I1111014_name(i,j), "7000", "20" )
     for i in [4,5,6,7]:
         useOnePt(CMS_2012_I1111014_name(i,j), "7000", "40" )
     for i in [8,9,10]:
         useOnePt(CMS_2012_I1111014_name(i,j), "7000", "80" )
     for i in [11,12,13,14,15,16]:
         useOnePt(CMS_2012_I1111014_name(i,j), "7000", "110" )
     for i in [17,18]:
         useOnePt(CMS_2012_I1111014_name(i,j), "7000", "210" )
     useOnePt(CMS_2012_I1111014_name(19,j), "7000", "260" )
     if(j<87) :
         for i in [20,21]:
             useOnePt(CMS_2012_I1111014_name(i,j), "7000", "400" )
     if(j<66) :
         useOnePt(CMS_2012_I1111014_name(22,j), "7000", "600" )
 
 for i in [126,127,128] :
     for j in [1,2] :
         mergeByPt("/CMS_2012_I1111014/d%03d-x01-y%02d" % (i,j), "7000")
         
 logging.info("Processing CMS_2018_I1682495")
 for i in [0,1,2,3] :
     useOnePt("/CMS_2018_I1682495/d%02d-x01-y01" % (12*i+ 1), "13000", "110" )
     useOnePt("/CMS_2018_I1682495/d%02d-x01-y01" % (12*i+ 2), "13000", "260" )
     useOnePt("/CMS_2018_I1682495/d%02d-x01-y01" % (12*i+ 3), "13000", "260" )
     useOnePt("/CMS_2018_I1682495/d%02d-x01-y01" % (12*i+ 4), "13000", "400" )
     useOnePt("/CMS_2018_I1682495/d%02d-x01-y01" % (12*i+ 5), "13000", "400" )
     useOnePt("/CMS_2018_I1682495/d%02d-x01-y01" % (12*i+ 6), "13000", "600" )
     useOnePt("/CMS_2018_I1682495/d%02d-x01-y01" % (12*i+ 7), "13000", "600" )
     useOnePt("/CMS_2018_I1682495/d%02d-x01-y01" % (12*i+ 8), "13000", "900" )
     useOnePt("/CMS_2018_I1682495/d%02d-x01-y01" % (12*i+ 9), "13000", "900" )
     useOnePt("/CMS_2018_I1682495/d%02d-x01-y01" % (12*i+10), "13000", "900" )
     useOnePt("/CMS_2018_I1682495/d%02d-x01-y01" % (12*i+11), "13000", "900" )
     useOnePt("/CMS_2018_I1682495/d%02d-x01-y01" % (12*i+12), "13000", "900" )
     
 logging.info("Processing CMS_2015_I1385107")
 for i in range(1,9) :
     mergeByPt("/CMS_2015_I1385107/d%02d-x01-y01" % i, "2760")
 
 
 logging.info("Processing CMS_2018_I1663452")
 useOneMass("/CMS_2018_I1663452/d01-x01-y01", "13000", "5900" )
 useOneMass("/CMS_2018_I1663452/d02-x01-y01", "13000", "4900" )
 useOneMass("/CMS_2018_I1663452/d03-x01-y01", "13000", "3900" )
 useOneMass("/CMS_2018_I1663452/d04-x01-y01", "13000", "3900" )
 useOneMass("/CMS_2018_I1663452/d05-x01-y01", "13000", "2800" )
 useOneMass("/CMS_2018_I1663452/d06-x01-y01", "13000", "2800" )
 useOneMass("/CMS_2018_I1663452/d07-x01-y01", "13000", "2200" )
     
 logging.info("Processing CMS_2017_I1519995")
 useOneMass("/CMS_2017_I1519995/d01-x01-y01", "13000", "3900" )
 useOneMass("/CMS_2017_I1519995/d02-x01-y01", "13000", "3900" )
 useOneMass("/CMS_2017_I1519995/d03-x01-y01", "13000", "2800" )
 useOneMass("/CMS_2017_I1519995/d04-x01-y01", "13000", "2800" )
 useOneMass("/CMS_2017_I1519995/d05-x01-y01", "13000", "2200" )
 useOneMass("/CMS_2017_I1519995/d06-x01-y01", "13000", "1600" )
 
 logging.info("Processing CMS_2016_I1486238")
 for i in [1,5,9,10,12,13,14,16,17] :
     useOnePt("/CMS_2016_I1486238/d%02d-x01-y01" % i, "7000", "20" )
 mergeByPt("/CMS_2016_I1486238/d11-x01-y01", "7000")
 mergeByPt("/CMS_2016_I1486238/d15-x01-y01", "7000")
 
 logging.info("Processing ATLAS_2018_I1634970")
 for i in range(1,7) :
     mergeByPt("/ATLAS_2018_I1634970/d%02d-x01-y01"%i, "13000")
 for i in range(7,13) :
     mergeByMass("/ATLAS_2018_I1634970/d%02d-x01-y01"%i, "13000", 1.)
 
 
 logging.info("Processing ATLAS_2017_I1604271")
 for i in range(1,13) :
     mergeByPt("/ATLAS_2017_I1604271/d%02d-x01-y01" % i, "8000")
     
 logging.info("Processing CMS_2017_I1598460")
 for i in range(1,7) :
     mergeByPt("/CMS_2017_I1598460/d%02d-x01-y01" % i, "8000")
 
 logging.info("Processing ATLAS_2019_I1724098")
 for i in range(1,45) :
     if(i<=6 or (i>=23 and i<=28)) :
         useOnePt("/ATLAS_2019_I1724098/d%02d-x01-y01" % i, "13000", "400")
     else :
         useOnePt("/ATLAS_2019_I1724098/d%02d-x01-y01" % i, "13000", "0")
 
 
 logging.info("Processing CMS_2018_I1643640")
 
 for i in range(0,5) :
     if i == 0 : ioff = 0
     else      : ioff = 8*i+1
     useOnePt("/CMS_2018_I1643640/d%02d-x01-y01"%(ioff+1), "13000", "110")
     useOnePt("/CMS_2018_I1643640/d%02d-x01-y01"%(ioff+2), "13000", "260")
     useOnePt("/CMS_2018_I1643640/d%02d-x01-y01"%(ioff+3), "13000", "400")
     useOnePt("/CMS_2018_I1643640/d%02d-x01-y01"%(ioff+4), "13000", "400")
     useOnePt("/CMS_2018_I1643640/d%02d-x01-y01"%(ioff+5), "13000", "600")
     useOnePt("/CMS_2018_I1643640/d%02d-x01-y01"%(ioff+6), "13000", "600")
     useOnePt("/CMS_2018_I1643640/d%02d-x01-y01"%(ioff+7), "13000", "600")
     useOnePt("/CMS_2018_I1643640/d%02d-x01-y01"%(ioff+8), "13000", "900")
     if(i==0) :
         useOnePt("/CMS_2018_I1643640/d%02d-x01-y01"%(ioff+9), "13000", "900")
 
 logging.info("Processing CMS_2019_I1719955")
 
 for i in range(0,2) :
     useOnePt("/CMS_2019_I1719955/d%02d-x01-y01"%(9*i+1), "13000", "110")
     useOnePt("/CMS_2019_I1719955/d%02d-x01-y01"%(9*i+2), "13000", "260")
     useOnePt("/CMS_2019_I1719955/d%02d-x01-y01"%(9*i+3), "13000", "400")
     useOnePt("/CMS_2019_I1719955/d%02d-x01-y01"%(9*i+4), "13000", "400")
     useOnePt("/CMS_2019_I1719955/d%02d-x01-y01"%(9*i+5), "13000", "600")
     useOnePt("/CMS_2019_I1719955/d%02d-x01-y01"%(9*i+6), "13000", "600")
     useOnePt("/CMS_2019_I1719955/d%02d-x01-y01"%(9*i+7), "13000", "600")
     useOnePt("/CMS_2019_I1719955/d%02d-x01-y01"%(9*i+8), "13000", "900")
     useOnePt("/CMS_2019_I1719955/d%02d-x01-y01"%(9*i+9), "13000", "900")
         
 logging.info("Processing ATLAS_2020_I1808726")
 pts=["400","600","900"]    
 for  i in range (0,3) :
     useOnePt("/ATLAS_2020_I1808726/d%02d-x01-y01"%(73+i),"13000",pts[i])
     for j in range (0,6) :
         for k in range(1,5) :
             useOnePt("/ATLAS_2020_I1808726/d%02d-x01-y01"%(4*i+12*j+k),"13000",pts[i])
 
 logging.info("Processing CMS_2021_I1972986")
 for i in range(1,5) :
     for j in range(0,40,20) :
         mergeByPt("/CMS_2021_I1972986/d%02d-x01-y01" % (i+j), "13000")
 
-logging.info("Processing CMS_2021_I1920187_DIJET")
+logging.info("Processing CMS_2021_I1920187")
 for ihist in [2,4,6,8,10,14,16,18]:
-    useOnePt("/CMS_2021_I1920187_DIJET/d%02d-x01-y01" % ihist, "13000","110")
-useOnePt("/CMS_2021_I1920187_DIJET/d12-x01-y01", "13000","900")
+    useOnePt("/CMS_2021_I1920187/d%02d-x01-y01" % ihist, "13000","110")
+useOnePt("/CMS_2021_I1920187/d12-x01-y01", "13000","900")
 for ihist in [155,179,209,234,265,291,322,348,379,405,436,462,492,517,547,572,
               602,627,657,682,712,737,768,794,825,851,882,908,939,965,996,
               1022,1053,1079,1110,1136,1167,1193,1224,1250,1271,1283,1314,1327,1358,1371,
               1402,1415,1446,1459,1490,1503,1525,1538,1560,1573,1595,1608,1630,1643,1674,
               1687,1718,1731,1762,1775,1806,1819,1850,1863,1894,1907,1938,1951,1982,1995,
               2026,2039,2070,2083]:
-    useOnePt("/CMS_2021_I1920187_DIJET/d%s-x01-y01" %  ihist    , "13000", "40") # 50-65
-    useOnePt("/CMS_2021_I1920187_DIJET/d%s-x01-y01" % (ihist+ 1), "13000", "40") # 65-88
-    useOnePt("/CMS_2021_I1920187_DIJET/d%s-x01-y01" % (ihist+ 2), "13000", "80") # 88-120
+    useOnePt("/CMS_2021_I1920187/d%s-x01-y01" %  ihist    , "13000", "40") # 50-65
+    useOnePt("/CMS_2021_I1920187/d%s-x01-y01" % (ihist+ 1), "13000", "40") # 65-88
+    useOnePt("/CMS_2021_I1920187/d%s-x01-y01" % (ihist+ 2), "13000", "80") # 88-120
     if ihist == 155 :
         ioff=0
     elif ihist == 209 or ihist==492 or ihist==547 or ihist==602 or ihist==657 or ihist==712 or ihist==1271:
         ioff=0
-        useOnePt("/CMS_2021_I1920187_DIJET/d%s-x01-y01" % (ihist+11), "13000","900") # 1000-4000
+        useOnePt("/CMS_2021_I1920187/d%s-x01-y01" % (ihist+11), "13000","900") # 1000-4000
     else :
         ioff=1
-        useOnePt("/CMS_2021_I1920187_DIJET/d%s-x01-y01" % (ihist+ 3), "13000","110") # 120-150
-        useOnePt("/CMS_2021_I1920187_DIJET/d%s-x01-y01" % (ihist+12), "13000","900") # 1000-4000
-    useOnePt("/CMS_2021_I1920187_DIJET/d%s-x01-y01" % (ihist+ 3+ioff), "13000","110") # 150-186
-    useOnePt("/CMS_2021_I1920187_DIJET/d%s-x01-y01" % (ihist+ 4+ioff), "13000","110") # 186-254 
-    useOnePt("/CMS_2021_I1920187_DIJET/d%s-x01-y01" % (ihist+ 5+ioff), "13000","210") # 254-326
-    useOnePt("/CMS_2021_I1920187_DIJET/d%s-x01-y01" % (ihist+ 6+ioff), "13000","260") # 326-408
-    useOnePt("/CMS_2021_I1920187_DIJET/d%s-x01-y01" % (ihist+ 7+ioff), "13000","260") # 408-481
-    useOnePt("/CMS_2021_I1920187_DIJET/d%s-x01-y01" % (ihist+ 8+ioff), "13000","260") # 481-614
-    useOnePt("/CMS_2021_I1920187_DIJET/d%s-x01-y01" % (ihist+ 9+ioff), "13000","600") # 614-800
-    useOnePt("/CMS_2021_I1920187_DIJET/d%s-x01-y01" % (ihist+10+ioff), "13000","600") # 800-1000
+        useOnePt("/CMS_2021_I1920187/d%s-x01-y01" % (ihist+ 3), "13000","110") # 120-150
+        useOnePt("/CMS_2021_I1920187/d%s-x01-y01" % (ihist+12), "13000","900") # 1000-4000
+    useOnePt("/CMS_2021_I1920187/d%s-x01-y01" % (ihist+ 3+ioff), "13000","110") # 150-186
+    useOnePt("/CMS_2021_I1920187/d%s-x01-y01" % (ihist+ 4+ioff), "13000","110") # 186-254 
+    useOnePt("/CMS_2021_I1920187/d%s-x01-y01" % (ihist+ 5+ioff), "13000","210") # 254-326
+    useOnePt("/CMS_2021_I1920187/d%s-x01-y01" % (ihist+ 6+ioff), "13000","260") # 326-408
+    useOnePt("/CMS_2021_I1920187/d%s-x01-y01" % (ihist+ 7+ioff), "13000","260") # 408-481
+    useOnePt("/CMS_2021_I1920187/d%s-x01-y01" % (ihist+ 8+ioff), "13000","260") # 481-614
+    useOnePt("/CMS_2021_I1920187/d%s-x01-y01" % (ihist+ 9+ioff), "13000","600") # 614-800
+    useOnePt("/CMS_2021_I1920187/d%s-x01-y01" % (ihist+10+ioff), "13000","600") # 800-1000
 
 logging.info("Processing CMS_2021_I1932460")
 for i in range(1,5):
     mergeByPt("/CMS_2021_I1932460/d%02d-x01-y01" % i, "13000")
 for i in range(5,15):
     useOnePt("/CMS_2021_I1932460/d%02d-x01-y01" % i, "13000","40")
 for i in range(45,51):
     useOnePt("/CMS_2021_I1932460/d%02d-x01-y01" % i, "13000","40")
 
 logging.info("Processing ATLAS_2019_I1740909")
 for i in [1,2,9]:
     mergeByPt("/ATLAS_2019_I1740909/d%02d-x01-y01" % i, "13000")
 pts = ["80" ,"110","260","400","400",
        "600","600","600","900","900",
        "900","900","900","1900"]
 for i in [13,27,41,55,69,83,97,111,125,139,153,167] :
     for j in range(0,14) :
         ihist=i+j
         if ihist < 100:
             useOnePt("/ATLAS_2019_I1740909/d%02d-x01-y01" % ihist, "13000",pts[j])
         else :
             useOnePt("/ATLAS_2019_I1740909/d%03d-x01-y01" % ihist, "13000",pts[j])
 
 logging.info("Processing ATLAS_2021_I1913061")
 for i in range(1,5) :
     useOnePt("/ATLAS_2021_I1913061/d%02d-x01-y01" % ihist, "13000","40")
 for i in range(5,7) :
     useOnePt("/ATLAS_2021_I1913061/d%02d-x01-y01" % ihist, "13000","40")
 for i in range(7,9) :
     mergeByPt("/ATLAS_2021_I1913061/d%02d-x01-y01" % i, "13000")
 
 # rescaling for semi-leptonic top decays (we only simulate 1 charge combination)
 for i in range(96,116,2) :
     rescale("/ATLAS_2018_I1656578/d%s-x01-y01" % i,2.)
 for i in range(15,29,2) :
     rescale("/ATLAS_2017_I1614149/d%s-x01-y01" % i,2.)
 for i in range(1,23,2) :
     rescale("/ATLAS_2015_I1404878/d%02d-x01-y01" % i,2.)
 rescale("/ATLAS_2015_I1397637/d01-x01-y01",2.)
 for i in range(1,22,1) :
     rescale("/ATLAS_2015_I1345452/d%02d-x01-y01" % i,2.)
 for i in range(1,10,1) :
     rescale("/ATLAS_2014_I1304688/d%02d-x01-y01" % i,2.)
 for i in range(1,82) :
     rescale("/CMS_2018_I1663958/d%02d-x01-y01" % i,2.)
 for i in range(169,173,1) :
     rescale("/CMS_2018_I1663958/d%02d-x01-y01" % i,2.)
 for i in range(8,15) :
     rescale("/CMS_2018_I1662081/d%02d-x01-y01" % i,2.)
 for i in range(1,41) :
     rescale("/CMS_2016_I1491950/d%02d-x02-y01" % i,2.)
 for i in range(1,13) :
     rescale("/CMS_2016_I1454211/d%02d-x01-y01" % i,2.)
 rescale("/CMS_2017_I1518399/d01-x01-y01",2.)
 for i in [4,8,12,16,20,24,28,32,36,40,44,48,52,75,76,77,78,79] :
     rescale("/ATLAS_2019_I1750330/d%02d-x01-y01" % i,2.)
 for i in [115,116,117,118,119,155,156,157,158,159,189,190,191,192,212,213,214,235,236,237,238,263,264,265,266,291,292,293,294,319,320,321,322,347,348,349,350,375,376,377,378,403,404,405,406,426,427,428,449,450,451,452,477,478,479,480,505,506,507,508,843,847,851,855,859,863,867,871,875,879,883,887,899,900,901,913,914,923,924,933,934,943,944,957,958,959,975,976,977,993,994,995,1007,1008,1021,1022,1023,] :
     rescale("/ATLAS_2019_I1750330/d%s-x01-y01" % i,2.)
     
 # Choose output file
 name = args[0]+"-Jets.yoda"
 yoda.writeYODA(outhistos,name)
 sys.exit(0)