From ebcb39270cd9075b6b5ef7455c0080a07713694b Mon Sep 17 00:00:00 2001
From: Sascha Stahl <sascha.stahl@cern.ch>
Date: Wed, 20 Apr 2016 06:58:12 +0200
Subject: [PATCH 1/4] Use TrackSys to configure public tools

---
 Hlt/HltConf/doc/release.notes                 |  3 ++
 Hlt/HltConf/python/HltConf/Configuration.py   |  7 ++++-
 Hlt/HltTracking/doc/release.notes             |  4 +++
 .../python/HltTracking/HltRecoConf.py         | 15 ++++++++--
 .../python/HltTracking/HltSharedTracking.py   | 29 -------------------
 5 files changed, 25 insertions(+), 33 deletions(-)

diff --git a/Hlt/HltConf/doc/release.notes b/Hlt/HltConf/doc/release.notes
index 7f20f26eb..274a4d278 100755
--- a/Hlt/HltConf/doc/release.notes
+++ b/Hlt/HltConf/doc/release.notes
@@ -4,6 +4,9 @@
 ! Purpose     : HLT Configuration
 ! -----------------------------------------------------------------------------
 
+! 2016-04-20 - Sascha Stahl
+ - Propagate DataType to HltRecoConf
+
 !========================= HltConf v13r9 2016-04-18 =========================
 
 ! 2016-04-18 - Roel Aaij
diff --git a/Hlt/HltConf/python/HltConf/Configuration.py b/Hlt/HltConf/python/HltConf/Configuration.py
index b08bbab7a..fb4e8bbd3 100755
--- a/Hlt/HltConf/python/HltConf/Configuration.py
+++ b/Hlt/HltConf/python/HltConf/Configuration.py
@@ -15,6 +15,8 @@ from HltMonitoring       import HltMonitoringConf
 from HltOutput           import HltOutputConf
 from HltPersistReco      import HltPersistRecoConf
 from ThresholdUtils import overwriteThresholds, Name2Threshold
+from Configurables       import HltRecoConf
+
 
 def __forAll__( c, prop_value_dict, types=['FilterDesktop','CombineParticles',"DVAlgorithm", "DaVinciAlgorithm", "DaVinciHistoAlgorithm", "DaVinciTupleAlgorithm", "*" ] ) :
     """ Find all configurable algorithms and set certain properties
@@ -72,7 +74,8 @@ class HltConf(LHCbConfigurableUser):
                              , HltMonitoringConf
                              , HltAfterburnerConf
                              , HltPersistRecoConf
-                             , HltOutputConf ]
+                             , HltOutputConf
+                             , HltRecoConf]
 
     __slots__ = { "L0TCK"                          : None
                 , 'ForceSingleL0Configuration'     : True
@@ -246,6 +249,8 @@ class HltConf(LHCbConfigurableUser):
             decoder = DecoderDB[n]
             decoder.setup().VetoObjects = [ loc for loc in decoder.listOutputs() ]
 
+        # Configure HltRecoConf with correct DataType
+        self.setOtherProps(HltRecoConf(),[ "DataType" ])
         #
         # dispatch Hlt1 configuration, don't do this if there are no HLT1 lines
         #
diff --git a/Hlt/HltTracking/doc/release.notes b/Hlt/HltTracking/doc/release.notes
index 547edc226..3eb97fcb8 100755
--- a/Hlt/HltTracking/doc/release.notes
+++ b/Hlt/HltTracking/doc/release.notes
@@ -4,6 +4,10 @@
 ! Purpose     : Steering the tracking by Hlt
 !-----------------------------------------------------------------------------
 
+! 2016-04-20 - Sascha Stahl
+ - Use configuration of public tracking tools from TrackSys. 
+ - Moved configuration of STTools to HltRecoConf.
+
 !========================= HltTracking v13r17 2016-04-18 =========================
 
 ! 2016-04-15 - Marian Stahl
diff --git a/Hlt/HltTracking/python/HltTracking/HltRecoConf.py b/Hlt/HltTracking/python/HltTracking/HltRecoConf.py
index 61b346d21..7f3317c82 100644
--- a/Hlt/HltTracking/python/HltTracking/HltRecoConf.py
+++ b/Hlt/HltTracking/python/HltTracking/HltRecoConf.py
@@ -25,9 +25,11 @@ from Gaudi.Configuration import *
 from LHCbKernel.Configuration import *
 
 from GaudiKernel.SystemOfUnits import MeV, mm, m
-
+from Configurables import TrackSys
 class HltRecoConf(LHCbConfigurableUser):
-    __slots__ = { "Forward_HPT_MinPt"           :  500. * MeV
+    __used_configurables__ = [ TrackSys ]
+    __slots__ = { "DataType"                    : "2016"
+                , "Forward_HPT_MinPt"           :  500. * MeV
                 , "Forward_HPT_MinP"            : 3000. * MeV
                 , "Forward_LPT_Muon_MinPt"      :  300. * MeV
                 , "Forward_LPT_Muon_MinP"       : 3000. * MeV
@@ -51,7 +53,6 @@ class HltRecoConf(LHCbConfigurableUser):
                 , "CalculateProbNN"             : True
                 , "AddGhostProb"                : True
                 , "InitFits"                    : True
-                , "CacheStatesInStateProvider"  : False
                 , "BeamGasMode"                 : False
                 , "VeloTrackingZMin"            : -2000.   #minimum velo tracking range
                 , "VeloTrackingZMax"            : +2000.   #maximum velo tracking range
@@ -87,10 +88,18 @@ class HltRecoConf(LHCbConfigurableUser):
         log.debug("HltReco configuration")
         import GaudiKernel.ProcessJobOptions
         GaudiKernel.ProcessJobOptions.PrintOff()
+
         # Configure the PV refitting correctly
         from Configurables import LoKi__PVReFitter
         LoKi__PVReFitter("LoKi::PVReFitter").CheckTracksByLHCbIDs = True
 
+        # Configure TrackSys
+        self.setOtherProps(TrackSys(),[ "DataType" ])
+        TrackSys().HltMode = True
+        
+        # Configure the position tool for lite (and full) clusters
+        from STTools import STOfflineConf
+        STOfflineConf.DefaultConf().configureTools()
 
 MatchVeloMuonOptions = {"MaxChi2DoFX" : 10.,
                         "XWindow" : 200.,
diff --git a/Hlt/HltTracking/python/HltTracking/HltSharedTracking.py b/Hlt/HltTracking/python/HltTracking/HltSharedTracking.py
index 5a7d8cedc..97f0fbd19 100755
--- a/Hlt/HltTracking/python/HltTracking/HltSharedTracking.py
+++ b/Hlt/HltTracking/python/HltTracking/HltSharedTracking.py
@@ -28,12 +28,6 @@ from Configurables import PVOfflineTool
 from HltLine.HltLine import bindMembers
 from Configurables import PatSeeding, PatSeedingTool
 
-#############################################################################################
-# Configure the position tool for lite (and full) clusters
-#############################################################################################
-from Configurables import STOnlinePosition
-from STTools import STOfflineConf
-STOfflineConf.DefaultConf().configureTools()
 #############################################################################################
 # Configure pattern recognition algorithms
 #############################################################################################
@@ -45,30 +39,7 @@ from Configurables import ToolSvc, TrackMasterExtrapolator, TrackStateProvider,
 from Configurables import SimplifiedMaterialLocator
 from Configurables import HltRecoConf
 
-## Simplified Material for public MasterExtrapolator and TrackStateProvider
-ToolSvc().addTool(TrackMasterExtrapolator, "TrackMasterExtrapolator")
-ToolSvc().TrackMasterExtrapolator.addTool(SimplifiedMaterialLocator, name="MaterialLocator")
-ToolSvc().TrackMasterExtrapolator.MaterialLocator.addTool( StateThickMSCorrectionTool, name= "StateMSCorrectionTool" )
-ToolSvc().addTool(TrackStateProvider, "TrackStateProvider")
-ToolSvc().TrackStateProvider.addTool(TrackMasterExtrapolator,name="Extrapolator")
-ToolSvc().TrackStateProvider.Extrapolator.addTool(SimplifiedMaterialLocator, name="MaterialLocator")
-ToolSvc().TrackStateProvider.Extrapolator.MaterialLocator.addTool( StateThickMSCorrectionTool, name= "StateMSCorrectionTool" )
-ToolSvc().TrackStateProvider.addTool(TrackInterpolator,"Interpolator")
-ToolSvc().TrackStateProvider.Interpolator.addTool(TrackMasterExtrapolator,name="Extrapolator")
-ToolSvc().TrackStateProvider.addTool(TrackInterpolator,"Interpolator")
-ToolSvc().TrackStateProvider.Interpolator.Extrapolator.addTool(SimplifiedMaterialLocator, name="MaterialLocator")
-ToolSvc().TrackStateProvider.Interpolator.Extrapolator.MaterialLocator.addTool( StateThickMSCorrectionTool, name= "StateMSCorrectionTool")
-if HltRecoConf().getProp("NewMSinFit"):
-    ToolSvc().TrackMasterExtrapolator.MaterialLocator.StateMSCorrectionTool.UseRossiAndGreisen = True
-    ToolSvc().TrackStateProvider.Extrapolator.MaterialLocator.StateMSCorrectionTool.UseRossiAndGreisen = True
-    ToolSvc().TrackStateProvider.Interpolator.Extrapolator.MaterialLocator.StateMSCorrectionTool.UseRossiAndGreisen = True
-if HltRecoConf().getProp("CacheStatesInStateProvider"):
-    ToolSvc().TrackStateProvider.CacheStatesOnDemand = True
-else:
-    ToolSvc().TrackStateProvider.CacheStatesOnDemand = False
-    
 #### Velo Tracking
-
 # the full Velo reconstruction
 def recoVelo(OutputTracksName=HltSharedTrackLoc["Velo"]):
     recoVelo = FastVeloTracking( 'FastVeloHlt', OutputTracksName = OutputTracksName)
-- 
GitLab


From 2246cb3855ae76400205ec14245cf8b675c69921 Mon Sep 17 00:00:00 2001
From: philten <philten@cern.ch>
Date: Sun, 24 Apr 2016 19:55:15 +0200
Subject: [PATCH 2/4] included new jet lines (single, low and hight pT)

---
 Hlt/Hlt2Lines/python/Hlt2Lines/Jets/Inputs.py |   1 +
 Hlt/Hlt2Lines/python/Hlt2Lines/Jets/Lines.py  | 135 +++++++++----
 Hlt/Hlt2Lines/python/Hlt2Lines/Jets/Stages.py | 181 ++++++++++--------
 .../HltSettings/Jets/Jets_25ns_Draft2016.py   | 100 ++++++++--
 4 files changed, 281 insertions(+), 136 deletions(-)

diff --git a/Hlt/Hlt2Lines/python/Hlt2Lines/Jets/Inputs.py b/Hlt/Hlt2Lines/python/Hlt2Lines/Jets/Inputs.py
index 5c13a009c..be8a380d8 100644
--- a/Hlt/Hlt2Lines/python/Hlt2Lines/Jets/Inputs.py
+++ b/Hlt/Hlt2Lines/python/Hlt2Lines/Jets/Inputs.py
@@ -1 +1,2 @@
 from Hlt2SharedParticles.TrackFittedBasicParticles import BiKalmanFittedMuons as Hlt2Muons
+from Hlt2SharedParticles.TrackFittedBasicParticles import BiKalmanFittedPions as Hlt2Pions
diff --git a/Hlt/Hlt2Lines/python/Hlt2Lines/Jets/Lines.py b/Hlt/Hlt2Lines/python/Hlt2Lines/Jets/Lines.py
index 03bd28951..ed20484a3 100644
--- a/Hlt/Hlt2Lines/python/Hlt2Lines/Jets/Lines.py
+++ b/Hlt/Hlt2Lines/python/Hlt2Lines/Jets/Lines.py
@@ -1,72 +1,131 @@
-from GaudiKernel.SystemOfUnits import MeV, GeV, picosecond, mm
+from GaudiKernel.SystemOfUnits import MeV, GeV
 from Hlt2Lines.Utilities.Hlt2LinesConfigurableUser import Hlt2LinesConfigurableUser
 
 # Jet Lines written by Phil Ilten and Mike Williams (mwill@mit.edu),
 # with Roel Aaij's significant assistance.
 
 class JetsLines(Hlt2LinesConfigurableUser):
-    __slots__ = {'_stages' : {},
-                 'Prescale' : {'Hlt2JetsDiJet'                : 1.e-3,
-                               'Hlt2JetsDiJetSV'                : 1.e-2},
-                 'Postscale' : {},
-                 'Common' : {
-                     'GHOSTPROB' : 0.2,
-                     'DPHI'      : 1.5,
-                     'SV_VCHI2'  : 10,
-                     'SV_TRK_PT' : 500*MeV,
-                     'SV_TRK_IPCHI2' : 16,
-                     'SV_FDCHI2' : 25,
-                     'MU_PT'     : 1000*MeV,
-                     'MU_PROBNNMU'  : 0.5,
-                     'JET_PT': 17*GeV},
-                 
-                 'JetBuilder' : {
-                     'JetPtMin' : 5 * GeV,
-                     'JetInfo' : False,
-                     'JetEcPath' : ""
-                     }
-                 }
+    __slots__ = {
+        '_stages': {},
+        'Prescale': {
+            'Hlt2JetsDiJetLowPt'    : 1e-04,
+            'Hlt2JetsDiJetMVLowPt'  : 1e-02,
+            'Hlt2JetsDiJetMuMuLowPt': 1e-01,
+            'Hlt2JetsDiJetSVLowPt'  : 1e-03,
+            'Hlt2JetsDiJetSVMuLowPt': 1e-02,
+            'Hlt2JetsDiJetSVSVLowPt': 1e-01,
+            'Hlt2JetsJetLowPt'      : 1e-04,
+            'Hlt2JetsJetDHLowPt'    : 1e-02,
+            'Hlt2JetsJetMuLowPt'    : 1e-03,
+            'Hlt2JetsJetSVLowPt'    : 1e-03,
+            'Hlt2JetsDiJet'         : 1e-03,
+            'Hlt2JetsDiJetSV'       : 1e-02,
+            'Hlt2JetsJet'           : 1e-03,
+            'Hlt2JetsJetDH'         : 1e-02,
+            'Hlt2JetsJetMu'         : 1e-03,
+            'Hlt2JetsJetSV'         : 1e-03
+            },
+        'Postscale': {},
+        'Common': {
+            'D_TOS'        : 'Hlt1(Two)?Track(MVA)?(Muon)?Decision%TOS',
+            'D_MASS'       : 50*MeV,
+            'GHOSTPROB'    : 0.2,
+            'DPHI'         : 0,
+            'SV_VCHI2'     : 10,
+            'SV_TRK_PT'    : 500*MeV,
+            'SV_TRK_IPCHI2': 16,
+            'SV_FDCHI2'    : 25,
+            'MU_PT'        : 1000*MeV,
+            'MU_PROBNNMU'  : 0.5,
+            'JET_PT'       : 17*GeV,
+            },
+        'JetBuilder': {
+            'JetPtMin'  : 5*GeV,
+            'JetInfo'   : False,
+            'JetEcPath' : ''
+            },
+        'JetsDiJetLowPt'    : {'JET_PT': 10*GeV},
+        'JetsDiJetMVLowPt'  : {'JET_PT': 10*GeV},
+        'JetsDiJetMuMuLowPt': {'JET_PT': 10*GeV},
+        'JetsDiJetSVLowPt'  : {'JET_PT': 10*GeV},
+        'JetsDiJetSVMuLowPt': {'JET_PT': 10*GeV},
+        'JetsDiJetSVSVLowPt': {'JET_PT': 10*GeV},
+        'JetsJetLowPt'      : {'JET_PT': 10*GeV},
+        'JetsJetDHLowPt'    : {'JET_PT': 10*GeV},
+        'JetsJetMuLowPt'    : {'JET_PT': 10*GeV},
+        'JetsJetSVLowPt'    : {'JET_PT': 10*GeV},
+        'JetsDiJetHighPt'   : {'JET_PT': 60*GeV},
+        'JetsDiJetSVHighPt' : {'JET_PT': 50*GeV},
+        'JetsJetHighPt'     : {'JET_PT': 100*GeV},
+        'JetsJetDHHighPt'   : {'JET_PT': 40*GeV},
+        'JetsJetMuHighPt'   : {'JET_PT': 60*GeV},
+        'JetsJetSVHighPt'   : {'JET_PT': 70*GeV}
+        }
 
     def stages(self, nickname = ''):
         if hasattr(self, '_stages') and self._stages:
             if nickname: return self._stages[nickname]
             else: return self._stages
         else: self._stages = {}
-
+        
         # Import the topo lines for the 2-body SVs.
         from Hlt2Lines.Topo.Lines import TopoLines
         from Hlt2Lines.Utilities.Hlt2Stage import Hlt2ExternalStage
         from Hlt2Lines.Utilities.Hlt2JetBuilder import Hlt2JetBuilder
-
+        from Stages import (FilterSV, FilterMuon, SVSVCombiner, SVMuCombiner,
+                            MuMuCombiner, DHCombiner)
         topo_lines = TopoLines()
-        topo_sv = Hlt2ExternalStage(topo_lines,
-                                    topo_lines.stages('Topo2BodyCombos')[0])
-
+        topo_sv = Hlt2ExternalStage(
+            topo_lines, topo_lines.stages('Topo2BodyCombos')[0])
 
-        from Stages import (FilterSV, FilterMuon, SVSVCombiner, SVMuCombiner, 
-                            MuMuCombiner, DiJetCombiner)
 
         # Create the stage filters.
         sv = [FilterSV([topo_sv])]
         mu = [FilterMuon()]
+        dh = [DHCombiner()]
         svsv = [SVSVCombiner(sv)]
         svmu = [SVMuCombiner(sv + mu)]
         mumu = [MuMuCombiner(mu)]
 
-        # The input tags correspond to 9600 + index (9600 SV, 9601 mu).
-        jets = [Hlt2JetBuilder('DiJetsJetBuilder', sv + mu, shared = True,
-                               nickname = 'JetBuilder')]
+        # The input tags, 9600 + index (9600 SV, 9601 mu, 9602 charm).
+        jets = [Hlt2JetBuilder('DiJetsJetBuilder', sv + mu + dh,
+                               shared = True, nickname = 'JetBuilder')]
 
-        # Create the stages.
-        self._stages['JetsDiJetSVSV'] = [DiJetCombiner(svsv + jets, 'SVSV')]
-        self._stages['JetsDiJetSVMu'] = [DiJetCombiner(svmu + jets, 'SVMu')]
-        self._stages['JetsDiJetMuMu'] = [DiJetCombiner(mumu + jets, 'MuMu')]
-        self._stages['JetsDiJetSV']   = [DiJetCombiner(sv + jets, 'SV')]
-        self._stages['JetsDiJet']     = [DiJetCombiner(jets, '')]
+        # Create the di-jet stages.
+        self.diJetStage('JetsDiJetSVSV', svsv + jets, 'SVSV')
+        self.diJetStage('JetsDiJetSVMu', svmu + jets, 'SVMu')
+        self.diJetStage('JetsDiJetMuMu', mumu + jets, 'MuMu')
+        self.diJetStage('JetsDiJetSV', sv + jets, 'SV')
+        self.diJetStage('JetsDiJetMV', sv + mu + jets, 'MV')
+        self.diJetStage('JetsDiJet', jets, '')
+
+        # Create the single jet stages.
+        self.jetStage('JetsJetSV', sv + jets, 'SV')
+        self.jetStage('JetsJetMu', mu + jets, 'Mu')
+        self.jetStage('JetsJetDH', dh + jets, 'DH')
+        self.jetStage('JetsJet', jets, '')
 
         # Return the stages.
         if nickname: return self._stages[nickname]
         else: return {k : v for k, v in self._stages.iteritems()}
+    
+    def diJetStage(self, name, inputs, tag):
+        from Stages import DiJetCombiner
+        props = self.getProps()
+        self._stages[name] = [DiJetCombiner(inputs, tag, '')]
+        if name + 'LowPt' in props: self._stages[name + 'LowPt'] = [
+            DiJetCombiner(inputs, tag, 'LowPt')]
+        if name + 'HighPt' in props: self._stages[name + 'HighPt'] = [
+            DiJetCombiner(inputs, tag, 'HighPt')]
+
+    def jetStage(self, name, inputs, tag):
+        from Stages import FilterJet
+        props = self.getProps()
+        self._stages[name] = [FilterJet(inputs, tag, '')]
+        if name + 'LowPt' in props: self._stages[name + 'LowPt'] = [
+            FilterJet(inputs, tag, 'LowPt')]
+        if name + 'HighPt' in props: self._stages[name + 'HighPt'] = [
+            FilterJet(inputs, tag, 'HighPt')]
 
     def __apply_configuration__(self) :
         from HltLine.HltLine import Hlt2Line
diff --git a/Hlt/Hlt2Lines/python/Hlt2Lines/Jets/Stages.py b/Hlt/Hlt2Lines/python/Hlt2Lines/Jets/Stages.py
index 2d0cddc40..87e1de83d 100644
--- a/Hlt/Hlt2Lines/python/Hlt2Lines/Jets/Stages.py
+++ b/Hlt/Hlt2Lines/python/Hlt2Lines/Jets/Stages.py
@@ -2,92 +2,119 @@ from Hlt2Lines.Utilities.Hlt2Combiner import Hlt2Combiner
 from Hlt2Lines.Utilities.Hlt2Filter import Hlt2ParticleFilter
 from Hlt2Lines.Utilities.Hlt2JetBuilder import Hlt2JetBuilder
 from HltTracking.HltPVs import PV3D
-from Inputs import Hlt2Muons
+from Inputs import Hlt2Muons, Hlt2Pions
 
 class FilterSV(Hlt2ParticleFilter):
-  def __init__(self, inputs):
-
-      pid  = "((ABSID=='K+') | (ID=='KS0') | (ABSID=='Lambda0'))"
-
-      code = ("(MINTREE("+pid+",PT) > %(SV_TRK_PT)s)"
-              "& (MINTREE(ISBASIC,TRGHOSTPROB) < %(GHOSTPROB)s) "
-              "& (MINTREE((ABSID=='K+'),MIPCHI2DV(PRIMARY)) > %(SV_TRK_IPCHI2)s)"
-              "& (HASVERTEX) & (VFASPF(VCHI2PDOF) < %(SV_VCHI2)s)"
-              "& (BPVVDCHI2 > %(SV_FDCHI2)s)")
-      Hlt2ParticleFilter.__init__(self, 'JetsSV', code, inputs, shared=True,dependencies = [PV3D('Hlt2')])
-
+    def __init__(self, inputs):
+        pid  = "((ABSID=='K+') | (ID=='KS0') | (ABSID=='Lambda0'))"
+        code = ("(MINTREE(" + pid + ",PT) > %(SV_TRK_PT)s)"
+                "& (MINTREE(ISBASIC,TRGHOSTPROB) < %(GHOSTPROB)s) "
+                "& (MINTREE((ABSID=='K+'),MIPCHI2DV(PRIMARY)) > "
+                "%(SV_TRK_IPCHI2)s)"
+                "& (HASVERTEX) & (VFASPF(VCHI2PDOF) < %(SV_VCHI2)s)"
+                "& (BPVVDCHI2 > %(SV_FDCHI2)s)")
+        Hlt2ParticleFilter.__init__(self, 'JetsSV', code, inputs, shared = 
+                                    True, dependencies = [PV3D('Hlt2')])
 
 class FilterMuon(Hlt2ParticleFilter):
-  def __init__(self):
+    def __init__(self):
+        inputs = [Hlt2Muons]
+        code = ("(PT > %(MU_PT)s) &  (PROBNNmu > %(MU_PROBNNMU)s)"
+                "& (TRGHOSTPROB < %(GHOSTPROB)s)")
+        Hlt2ParticleFilter.__init__(self,'JetsMuon', code, inputs, shared = 
+                                    True, dependencies = [PV3D('Hlt2')])
 
-      inputs = [Hlt2Muons]
-      code = ("(PT > %(MU_PT)s) &  (PROBNNmu > %(MU_PROBNNMU)s)"
-              "& (TRGHOSTPROB < %(GHOSTPROB)s)")
-      Hlt2ParticleFilter.__init__(self,'JetsMuon', code, inputs,
-                                  shared = True, dependencies = [PV3D('Hlt2')])
+class FilterJet(Hlt2ParticleFilter):
+    def __init__(self, inputs, tag, pt):
+        tags = {'SV': 0, 'Mu': 1, 'DH': 2}
+        code = "(ABSID == 'CELLjet') & (PT > %(JET_PT)s)"
+        if tag in tags: code += ('& (INFO(%i, -1) != -1)' % (tags[tag] + 9600))
+        Hlt2ParticleFilter.__init__(self, 'JetsJet' + tag + pt,
+                                    code, inputs, shared = True,
+                                    dependencies = [PV3D('Hlt2')])
 
+class DHCombiner(Hlt2Combiner):
+    def __init__(self):
+        inputs = [Hlt2Pions]
+        cc = ("(AMINCHILD(PT) > %(SV_TRK_PT)s)"
+              "& (AMAXCHILD(TRGHOSTPROB) < %(GHOSTPROB)s)"
+              "& (AMINCHILD(MIPCHI2DV(PRIMARY)) > %(SV_TRK_IPCHI2)s)"
+              "& (((ANUM(ISBASIC) == 2) & " 
+              + self.wmass('1.865*GeV', ['pi+', 'K+']) + ")"
+              "| ((ANUM(ISBASIC) == 3) & ("
+              + self.wmass('1.87*GeV', ['pi+', 'pi+', 'K+']) + " | "
+              + self.wmass('1.968*GeV', ['pi+', 'K+', 'K+']) + " | "
+              + self.wmass('2.286*GeV', ['pi+', 'K+', 'p+']) + ")))")
+        mc = ("(HASVERTEX) & (VFASPF(VCHI2PDOF) < %(SV_VCHI2)s)"
+              "& (BPVVDCHI2 > %(SV_FDCHI2)s)")
+        Hlt2Combiner.__init__(self, 'JetsDH', ["[D0 -> pi- pi+]cc",
+                                               "[D+ -> pi- pi+ pi+]cc"],
+                              inputs, dependencies = [PV3D('Hlt2')],
+                              CombinationCut = cc, MotherCut = mc,
+                              Preambulo = [], shared = True,
+                              tistos = 'D_TOS')
+    def wmass(self, mass, pids):
+        from itertools import permutations
+        perms = list(permutations(pids)); cuts = []
+        for perm in perms:
+            cuts += ["in_range(%s - %%(D_MASS)s, AWM%s, %s + %%(D_MASS)s)" 
+                     % (mass, str(tuple(perm)), mass)]
+        return ' | '.join(cuts)
 
-class SVSVCombiner(Hlt2Combiner) :
-  def __init__(self, inputs):
-
-      cc = "(abs(ACHILD(BPVPHI,1)-ACHILD(BPVPHI,2)) > (%(DPHI)s-1.0))"
-
-      Hlt2Combiner.__init__(self, 'JetsSVSV', "D0  -> K*(892)0 K*(892)0", inputs,
-                            dependencies = [PV3D('Hlt2')],
-                            CombinationCut = cc,
-                            MotherCut = '(ALL)',
-                            Preambulo = [],
-                            shared = True,ParticleCombiners={ '' : 'ParticleAdder'})
+class SVSVCombiner(Hlt2Combiner):
+    def __init__(self, inputs):
+        cc = "(abs(ACHILD(BPVPHI,1)-ACHILD(BPVPHI,2)) > (%(DPHI)s-1.0))"
+        Hlt2Combiner.__init__(self, 'JetsSVSV', "D0  -> K*(892)0 K*(892)0",
+                              inputs, dependencies = [PV3D('Hlt2')],
+                              CombinationCut = cc, MotherCut = '(ALL)',
+                              Preambulo = [], shared = True,
+                              ParticleCombiners={'': 'ParticleAdder'})
 
 
-class SVMuCombiner(Hlt2Combiner) :
-  def __init__(self, inputs):
-    cc = ("(abs(ACHILD(BPVPHI, 1) - ACHILD(PHI, 2)) > (%(DPHI)s - 1.0))"
-          " & (ACHILD(ABSID, 1) == 313) & (ACHILD(ABSID, 2) == 13)")
-    Hlt2Combiner.__init__(self, 'JetsSVMu', 
-                          ["D0 -> K*(892)0 mu+","D0 -> K*(892)0 mu-"], inputs,
-                          dependencies = [PV3D('Hlt2')],
-                          CombinationCut = cc,
-                          MotherCut = '(ALL)',
-                          Preambulo = [],
-                          shared = True,ParticleCombiners = 
-                          { '' : 'ParticleAdder'})
+class SVMuCombiner(Hlt2Combiner):
+    def __init__(self, inputs):
+        cc = ("(abs(ACHILD(BPVPHI, 1) - ACHILD(PHI, 2)) > (%(DPHI)s - 1.0))"
+              " & (ACHILD(ABSID, 1) == 313) & (ACHILD(ABSID, 2) == 13)")
+        Hlt2Combiner.__init__(self, 'JetsSVMu', ["D0 -> K*(892)0 mu+",
+                                                 "D0 -> K*(892)0 mu-"], inputs,
+                              dependencies = [PV3D('Hlt2')], 
+                              CombinationCut = cc, MotherCut = '(ALL)',
+                              Preambulo = [], shared = True, 
+                              ParticleCombiners = {'': 'ParticleAdder'})
     
 class MuMuCombiner(Hlt2Combiner) :
-  def __init__(self, inputs):
-
-      cc = "(abs(ACHILD(PHI,1)-ACHILD(PHI,2)) > (%(DPHI)s-1.0))"
-      Hlt2Combiner.__init__(self, 'JetsMuMu', ["[D0 -> mu+ mu+]cc","D0 -> mu+ mu-"], inputs,
-                            dependencies = [PV3D('Hlt2')],
-                            CombinationCut = cc,
-                            MotherCut = '(ALL)',
-                            Preambulo = [],
-                            shared = True,ParticleCombiners={ '' : 'ParticleAdder'})
+    def __init__(self, inputs):
+        cc = "(abs(ACHILD(PHI,1)-ACHILD(PHI,2)) > (%(DPHI)s-1.0))"
+        Hlt2Combiner.__init__(self, 'JetsMuMu', ["[D0 -> mu+ mu+]cc", 
+                                                 "D0 -> mu+ mu-"], inputs,
+                              dependencies = [PV3D('Hlt2')],
+                              CombinationCut = cc, MotherCut = '(ALL)',
+                              Preambulo = [], shared = True,
+                              ParticleCombiners = {'': 'ParticleAdder'})
 
-# Combine two jets with optional tags.
-class DiJetCombiner(Hlt2Combiner) :
-  def __init__(self, inputs, tag = None):
-      cc = ("(AMINCHILD(PT) > %(JET_PT)s)"
-            " & (abs(ACHILD(PHI,1) - ACHILD(PHI,2)) > %(DPHI)s)")
-      if tag == 'SV':
-        cc += (" & ((ACHILD(INFO(9600, -1), 1) != -1)"
-               " | (ACHILD(INFO(9600, -1), 2) != -1))")
-      elif tag == 'SVSV':
-        cc += (" & (ACHILD(INFO(9600, -1), 1) != -1)"
-               " & (ACHILD(INFO(9600, -1), 2) != -1)")
-      elif tag == 'MuMu':
-        cc += (" & (ACHILD(INFO(9601, -1), 1) != -1)"
-               " & (ACHILD(INFO(9601, -1), 2) != -1)")
-      elif tag == "SVMu":
-        cc += (" & (((ACHILD(INFO(9600, -1), 1) != -1)"
-               " & (ACHILD(INFO(9601, -1), 2) != -1))"
-               " | ((ACHILD(INFO(9601, -1), 1) != -1)"
-               " & (ACHILD(INFO(9600, -1), 2) != -1)))")
-      Hlt2Combiner.__init__(self, 'DiJet' + tag, 
-                            ["CLUSjet -> CELLjet CELLjet"], inputs,
-                            dependencies = [PV3D('Hlt2')],
-                            CombinationCut = cc,
-                            MotherCut = '(ALL)',
-                            Preambulo = [],
-                            shared = True, ParticleCombiners = 
-                            {'': 'ParticleAdder'})
+class DiJetCombiner(Hlt2Combiner):
+    def __init__(self, inputs, tag, pt):
+        tags = {
+            'SV':   (" & ((ACHILD(INFO(9600, -1), 1) != -1)"
+                     " | (ACHILD(INFO(9600, -1), 2) != -1))"),
+            'MV':   (" & (((ACHILD(INFO(9600, -1), 1) != -1)"
+                     " & (ACHILD(INFO(9601, -1), 1) != -1))"
+                     " | ((ACHILD(INFO(9601, -1), 2) != -1)"
+                     " & (ACHILD(INFO(9600, -1), 2) != -1)))"),
+            'SVSV': (" & (ACHILD(INFO(9600, -1), 1) != -1)"
+                     " & (ACHILD(INFO(9600, -1), 2) != -1)"),
+            'MuMu': (" & (ACHILD(INFO(9601, -1), 1) != -1)"
+                     " & (ACHILD(INFO(9601, -1), 2) != -1)"),
+            'SVMu': (" & (((ACHILD(INFO(9600, -1), 1) != -1)"
+                     " & (ACHILD(INFO(9601, -1), 2) != -1))"
+                     " | ((ACHILD(INFO(9601, -1), 1) != -1)"
+                     " & (ACHILD(INFO(9600, -1), 2) != -1)))")}
+        cc = ("(AMINCHILD(PT) > %(JET_PT)s)"
+              " & (abs(ACHILD(PHI,1) - ACHILD(PHI,2)) > %(DPHI)s)")
+        if tag in tags: cc += tags[tag]
+        Hlt2Combiner.__init__(self, 'JetsDiJet' + tag + pt, 
+                              ["CLUSjet -> CELLjet CELLjet"], inputs,
+                              dependencies = [PV3D('Hlt2')],
+                              CombinationCut = cc, MotherCut = '(ALL)',
+                              Preambulo = [], shared = True,
+                              ParticleCombiners = {'': 'ParticleAdder'})
diff --git a/Hlt/HltSettings/python/HltSettings/Jets/Jets_25ns_Draft2016.py b/Hlt/HltSettings/python/HltSettings/Jets/Jets_25ns_Draft2016.py
index ed5ab1d7e..16c0fd581 100644
--- a/Hlt/HltSettings/python/HltSettings/Jets/Jets_25ns_Draft2016.py
+++ b/Hlt/HltSettings/python/HltSettings/Jets/Jets_25ns_Draft2016.py
@@ -16,11 +16,32 @@ class Jets_25ns_Draft2016:
       """Returns a list of active lines."""
       
       lines = [
-         'Hlt2JetsDiJet',
-         'Hlt2JetsDiJetSV',
-         'Hlt2JetsDiJetSVSV',
+         'Hlt2JetsDiJetLowPt'    ,
+         'Hlt2JetsDiJetMVLowPt'  ,
+         'Hlt2JetsDiJetMuMuLowPt',
+         'Hlt2JetsDiJetSVLowPt'  ,
+         'Hlt2JetsDiJetSVMuLowPt',
+         'Hlt2JetsDiJetSVSVLowPt',
+         'Hlt2JetsJetLowPt'      ,
+         'Hlt2JetsJetDHLowPt'    ,
+         'Hlt2JetsJetMuLowPt'    ,
+         'Hlt2JetsJetSVLowPt'    ,
+         'Hlt2JetsDiJet'    ,
+         'Hlt2JetsDiJetMV'  ,
+         'Hlt2JetsDiJetMuMu',
+         'Hlt2JetsDiJetSV'  ,
          'Hlt2JetsDiJetSVMu',
-         'Hlt2JetsDiJetMuMu'
+         'Hlt2JetsDiJetSVSV',
+         'Hlt2JetsJet'      ,
+         'Hlt2JetsJetDH'    ,
+         'Hlt2JetsJetMu'    ,
+         'Hlt2JetsJetSV'    ,
+         'Hlt2JetsDiJetHighPt'  ,
+         'Hlt2JetsDiJetSVHighPt',
+         'Hlt2JetsJetHighPt'    ,
+         'Hlt2JetsJetDHHighPt'  ,
+         'Hlt2JetsJetMuHighPt'  ,
+         'Hlt2JetsJetSVHighPt'  
          ]
       
       return lines
@@ -33,22 +54,59 @@ class Jets_25ns_Draft2016:
       from Hlt2Lines.Jets.Lines import JetsLines
       d.update({
             JetsLines : {
-               'Prescale' : {'Hlt2JetsDiJet'                : 1.e-3,
-                             'Hlt2JetsDiJetSV'                : 1.e-2},
-               'Common' : {
-                  'GHOSTPROB' : 0.2,
-                  'DPHI'      : 1.5,
-                  'SV_VCHI2'  : 10,
-                  'SV_TRK_PT' : 500*MeV,
-                  'SV_TRK_IPCHI2' : 16,
-                  'SV_FDCHI2' : 25,
-                  'MU_PT'     : 1000*MeV,
-                  'MU_PROBNNMU'  : 0.5,
-                  'JET_PT' : 17*GeV},
-               
-               'JetBuilder' : {
-                  'JetPtMin' : 5 * GeV,
-                  'JetInfo' : False,
-                  'JetEcPath' : ""}}})
+        'Prescale': {
+            'Hlt2JetsDiJetLowPt'    : 1e-04,
+            'Hlt2JetsDiJetMVLowPt'  : 1e-02,
+            'Hlt2JetsDiJetMuMuLowPt': 1e-01,
+            'Hlt2JetsDiJetSVLowPt'  : 1e-03,
+            'Hlt2JetsDiJetSVMuLowPt': 1e-02,
+            'Hlt2JetsDiJetSVSVLowPt': 1e-01,
+            'Hlt2JetsJetLowPt'      : 1e-04,
+            'Hlt2JetsJetDHLowPt'    : 1e-02,
+            'Hlt2JetsJetMuLowPt'    : 1e-03,
+            'Hlt2JetsJetSVLowPt'    : 1e-03,
+            'Hlt2JetsDiJet'         : 1e-03,
+            'Hlt2JetsDiJetSV'       : 1e-02,
+            'Hlt2JetsJet'           : 1e-03,
+            'Hlt2JetsJetDH'         : 1e-02,
+            'Hlt2JetsJetMu'         : 1e-03,
+            'Hlt2JetsJetSV'         : 1e-03
+            },
+        'Postscale': {},
+        'Common': {
+            'D_TOS'        : 'Hlt1(Two)?Track(MVA)?(Muon)?Decision%TOS',
+            'D_MASS'       : 50*MeV,
+            'GHOSTPROB'    : 0.2,
+            'DPHI'         : 0,
+            'SV_VCHI2'     : 10,
+            'SV_TRK_PT'    : 500*MeV,
+            'SV_TRK_IPCHI2': 16,
+            'SV_FDCHI2'    : 25,
+            'MU_PT'        : 1000*MeV,
+            'MU_PROBNNMU'  : 0.5,
+            'JET_PT'       : 17*GeV,
+            },
+        'JetBuilder': {
+            'JetPtMin'  : 5*GeV,
+            'JetInfo'   : False,
+            'JetEcPath' : ''
+            },
+        'JetsDiJetLowPt'    : {'JET_PT': 10*GeV},
+        'JetsDiJetMVLowPt'  : {'JET_PT': 10*GeV},
+        'JetsDiJetMuMuLowPt': {'JET_PT': 10*GeV},
+        'JetsDiJetSVLowPt'  : {'JET_PT': 10*GeV},
+        'JetsDiJetSVMuLowPt': {'JET_PT': 10*GeV},
+        'JetsDiJetSVSVLowPt': {'JET_PT': 10*GeV},
+        'JetsJetLowPt'      : {'JET_PT': 10*GeV},
+        'JetsJetDHLowPt'    : {'JET_PT': 10*GeV},
+        'JetsJetMuLowPt'    : {'JET_PT': 10*GeV},
+        'JetsJetSVLowPt'    : {'JET_PT': 10*GeV},
+        'JetsDiJetHighPt'   : {'JET_PT': 60*GeV},
+        'JetsDiJetSVHighPt' : {'JET_PT': 50*GeV},
+        'JetsJetHighPt'     : {'JET_PT': 100*GeV},
+        'JetsJetDHHighPt'   : {'JET_PT': 40*GeV},
+        'JetsJetMuHighPt'   : {'JET_PT': 60*GeV},
+        'JetsJetSVHighPt'   : {'JET_PT': 70*GeV}
+        }})
       
       return d
-- 
GitLab


From 8d96daffda43a53e920d4cc84ebd4ba9d8ad5440 Mon Sep 17 00:00:00 2001
From: Roel Aaij <raaij@nikhef.nl>
Date: Mon, 25 Apr 2016 15:18:49 +0200
Subject: [PATCH 3/4] Rename TurboFull to TurboRaw and add DstData to be kept
 by Turbo stripper.

---
 Hlt/HltConf/python/HltConf/HltOutput.py | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/Hlt/HltConf/python/HltConf/HltOutput.py b/Hlt/HltConf/python/HltConf/HltOutput.py
index bf851d1ce..19c4e2e6c 100644
--- a/Hlt/HltConf/python/HltConf/HltOutput.py
+++ b/Hlt/HltConf/python/HltConf/HltOutput.py
@@ -35,7 +35,7 @@ class HltOutputConf(LHCbConfigurableUser):
     ## Streams we know about: {name : rb}
     __streams__ = {"VELOCLOSING" : 40,
                    "HLT1NOBIAS"  : 48,
-                   "TURBOFULL"   : 85,
+                   "TURBORAW"    : 85,
                    "BEAMGAS"     : 86,
                    "FULL"        : 87,
                    "TURBO"       : 88,
@@ -60,9 +60,9 @@ class HltOutputConf(LHCbConfigurableUser):
                                              (["PARKED"],    []),
                                              (["NOBIAS"],    []),
                                              (["SMOGPHYS"],  []),
-                                             (["TURBOFULL"], []),
+                                             (["TURBORAW"], []),
                                              (["LUMI"], ['ODIN', 'HltLumiSummary', 'HltRoutingBits', 'DAQ']),
-                                             (["TURBO"],['ODIN', 'HltLumiSummary', 'DAQ',
+                                             (["TURBO"],['ODIN', 'HltLumiSummary', 'DAQ', 'DstData',
                                                          'HltRoutingBits', 'HltDecReports', 'HltSelReports', 'HltVertexReports', 'HltTrackReports',
                                                          'L0DU', 'L0Calo', 'L0PU', 'L0PUFull', 'L0Muon', 'L0CaloFull',
                                                          'L0MuonCtrlAll', 'L0MuonProcCand', 'L0MuonProcData', 'L0MuonCtrlAll'])],
@@ -70,11 +70,11 @@ class HltOutputConf(LHCbConfigurableUser):
                                              "BEAMGAS" : None,
                                              "FULL" : None,
                                              "TURBO" : None,
-                                             "TURBOFULL" : None,
+                                             "TURBORAW" : None,
                                              "TURCAL" : None,
                                              "VELOCLOSING" : None,
                                              "HLT1NOBIAS"  : None},
-                 'StreamsWithLumi'        : ['FULL', 'TURCAL', 'TURBO', 'TURBOFULL', 'NOBIAS', 'SMOGPHYS', 'PARKED'],
+                 'StreamsWithLumi'        : ['FULL', 'TURCAL', 'TURBO', 'TURBORAW', 'NOBIAS', 'SMOGPHYS', 'PARKED'],
                  'OutputAlgProperties'    : None,
                  'HltEndSequence'         : None,
                  'LumiPredicate'          : "HLT_PASS('Hlt2LumiDecision')",
-- 
GitLab


From 7e613f957c5720ff6e60d860b1ca9d528eba090d Mon Sep 17 00:00:00 2001
From: Roel Aaij <raaij@nikhef.nl>
Date: Mon, 25 Apr 2016 18:12:08 +0200
Subject: [PATCH 4/4] Remove duplicate entry in Turbo banks.

---
 Hlt/HltConf/python/HltConf/HltOutput.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/Hlt/HltConf/python/HltConf/HltOutput.py b/Hlt/HltConf/python/HltConf/HltOutput.py
index 19c4e2e6c..812b23f71 100644
--- a/Hlt/HltConf/python/HltConf/HltOutput.py
+++ b/Hlt/HltConf/python/HltConf/HltOutput.py
@@ -65,7 +65,7 @@ class HltOutputConf(LHCbConfigurableUser):
                                              (["TURBO"],['ODIN', 'HltLumiSummary', 'DAQ', 'DstData',
                                                          'HltRoutingBits', 'HltDecReports', 'HltSelReports', 'HltVertexReports', 'HltTrackReports',
                                                          'L0DU', 'L0Calo', 'L0PU', 'L0PUFull', 'L0Muon', 'L0CaloFull',
-                                                         'L0MuonCtrlAll', 'L0MuonProcCand', 'L0MuonProcData', 'L0MuonCtrlAll'])],
+                                                         'L0MuonCtrlAll', 'L0MuonProcCand', 'L0MuonProcData'])],
                  'EnabledStreams'         : {"LUMI" : None,
                                              "BEAMGAS" : None,
                                              "FULL" : None,
-- 
GitLab