Exemplo n.º 1
0
def execute(simulation=True,
            turbo=True,
            decay_descriptor="J/psi(1S) -> mu- mu+"):
    # Configure all the unpacking, algorithms, tags and input files
    appConf = ApplicationMgr()
    appConf.ExtSvc+= ['ToolSvc', 'DataOnDemandSvc', LoKiSvc()]

    ConfigTarFileAccessSvc().File = 'config.tar'
    
    dv = DaVinci()
    dv.DataType = "2012"

    lhcbApp = LHCbApp()
    lhcbApp.Simulation = simulation
    CondDB().Upgrade = False
    
    dtt = DecayTreeTuple("Early2015")
    if turbo:
        tesla_prefix = "Hlt2DiMuonJPsi"
        dtt.Inputs = ["/Event/"+tesla_prefix+"/Particles"]
        dtt.InputPrimaryVertices = "/Event/"+tesla_prefix+"/Primary"
        dtt.WriteP2PVRelations = False

    else:
        LHCbApp().DDDBtag = "dddb-20140729"
        polarity = "u"
        LHCbApp().CondDBtag = "sim-20140730-vc-m%s100"%polarity
        muons = AutomaticData(Location="Phys/StdAllLooseMuons/Particles")

        jpsi = CombineParticles('MyJPsi')
        jpsi.DecayDescriptors = [decay_descriptor]
        jpsi.CombinationCut = "(AM < 7100.0 *GeV)"
        jpsi.DaughtersCuts = {"": "ALL", "mu+": "ALL", "mu-": "ALL"}
        jpsi.MotherCut = "(VFASPF(VCHI2/VDOF) < 999999.0)"
        
        code = """
('J/psi(1S)' == ID) &
in_range(2.990*GeV, M, 3.210*GeV) &
DECTREE('%s') &
CHILDCUT(1, HASMUON & ISMUON) &
CHILDCUT(2, HASMUON & ISMUON) &
(MINTREE('mu+' == ABSID, PT) > 700*MeV) &
(MAXTREE(ISBASIC & HASTRACK, TRCHI2DOF) < 5) &
(MINTREE(ISBASIC & HASTRACK, CLONEDIST) > 5000) &
(VFASPF(VPCHI2) > 0.5/100) &
(abs(BPV(VZ)) <  0.5*meter) &
(BPV(vrho2) < (10*mm)**2)
"""%(decay_descriptor)
        # similar to the HLT2 line
        code = """
(ADMASS('J/psi(1S)')< 120*MeV) &
DECTREE('%s') &
(PT>0*MeV) &
(MAXTREE('mu-'==ABSID,TRCHI2DOF) < 4) &
(MINTREE('mu-'==ABSID,PT)> 0*MeV) &
(VFASPF(VCHI2PDOF)< 25)
"""%(decay_descriptor)
        filter_jpsi = FilterDesktop("MyFilterJPsi",
                                    Code=code,
                                    Preambulo=["vrho2 = VX**2 + VY**2"],
                                    ReFitPVs=True,
                                    #IgnoreP2PVFromInputLocations=True,
                                    #WriteP2PVRelations=True
                                    )
        
        jpsi_sel = Selection("SelMyJPsi", Algorithm=jpsi, RequiredSelections=[muons])
        filter_jpsi_sel = Selection("SelFilterMyJPsi",
                                    Algorithm=filter_jpsi,
                                    RequiredSelections=[jpsi_sel])
        jpsi_seq = SelectionSequence("SeqMyJPsi", TopSelection=filter_jpsi_sel)
        dtt.Inputs = [jpsi_seq.outputLocation()]
    
    # Overwriting default list of TupleTools
    dtt.ToolList = ["TupleToolKinematic",
                    "TupleToolPid",
                    "TupleToolEventInfo",
                    "TupleToolMCBackgroundInfo",
                    "TupleToolMCTruth",
                    #"MCTupleToolHierarchy",
                    #"MCTupleToolPID",
                    "TupleToolGeometry",
                    "TupleToolTISTOS",
                    # with turbo this crashes
                    #"TupleToolTrackInfo",
                    "TupleToolTrigger",
                    ]
    tlist = ["L0HadronDecision", "L0MuonDecision",
             "L0DiMuonDecision", "L0ElectronDecision",
             "L0PhotonDecision",
             "Hlt1DiMuonHighMassDecision", "Hlt1DiMuonLowMassDecision",
             "Hlt1TrackMuonDecision", "Hlt1TrackAllL0Decision",
             "Hlt2DiMuonJPsiDecision", "Hlt2SingleMuonDecision",
             ]
    
    dtt.addTool(TupleToolTrigger, name="TupleToolTrigger")
    dtt.addTool(TupleToolTISTOS, name="TupleToolTISTOS")
    # Get trigger info
    dtt.TupleToolTrigger.Verbose = True
    dtt.TupleToolTrigger.TriggerList = tlist
    dtt.TupleToolTISTOS.Verbose = True
    dtt.TupleToolTISTOS.TriggerList = tlist

    from Configurables import TupleToolMCTruth, MCTupleToolHierarchy
    dtt.addTool(TupleToolMCBackgroundInfo,
                name="TupleToolMCBackgroundInfo")
    dtt.TupleToolMCBackgroundInfo.Verbose = True
    dtt.addTool(MCTupleToolHierarchy,
                name="MCTupleToolHierarchy")
    dtt.MCTupleToolHierarchy.Verbose = True
    dtt.addTool(TupleToolMCTruth,
                name="TupleToolMCTruth")
    dtt.TupleToolMCTruth.Verbose = True

    if turbo:
        assoc_seq = TeslaTruthUtils.associateSequence(tesla_prefix, False)
        ChargedPP2MC(tesla_prefix+"ProtoAssocPP").OutputLevel = 1
        
        assoc_seq.Members.insert(0, PatLHCbID2MCParticle())

        from Configurables import MuonCoord2MCParticleLink
        muon_coords = MuonCoord2MCParticleLink("TeslaMuonCoordLinker")
        assoc_seq.Members.insert(1, muon_coords)
    
        TrackAssociator("TeslaAssocTr").DecideUsingMuons = True
        
        relations = TeslaTruthUtils.getRelLoc(tesla_prefix)

    else:
        relations = "Relations/Rec/ProtoP/Charged"


    TeslaTruthUtils.makeTruth(dtt,
                              relations,
                              ["MCTupleToolKinematic",
                               "MCTupleToolHierarchy",
                               "MCTupleToolPID",
                               ]
                              )
    
    
    dtt.Decay = mark(2, mark(3, decay_descriptor)) #"J/psi(1S) -> ^mu- ^mu+"
    
    dtt.addBranches({"X": "^(%s)"%(decay_descriptor),
                     "muplus": mark(3, decay_descriptor),#"J/psi(1S) -> mu- ^mu+",
                     "muminus": mark(2, decay_descriptor),#"J/psi(1S) -> ^mu- mu+",
                     })
    
    x_preamble = ["DZ = VFASPF(VZ) - BPV(VZ)",
                  ]
    x_vars = {"ETA": "ETA",
              "Y": "Y",
              "PHI": "PHI",
              "VPCHI2": "VFASPF(VPCHI2)",
              "DELTAZ": "DZ",
              # DZ * M / PZ / c with c in units of mm/s
              # XXX should this be the PDG mass or measured mass?
              #"TZ": "DZ*M / PZ / 299792458000.0", #seconds
              "TZ": "DZ*3096.916 / PZ/299792458000.0*(10**12)", #ps
              "minpt": "MINTREE('mu+' == ABSID, PT)",
              "minclonedist": "MINTREE(ISBASIC & HASTRACK, CLONEDIST)",
              "maxtrchi2dof": "MAXTREE(ISBASIC & HASTRACK, TRCHI2DOF)",
              }
    muon_vars = {"ETA": "ETA",
                 "Y": "Y",
                 "PHI": "PHI",
                 "CHARGE": "Q",
                 "CLONEDIST": "CLONEDIST",
                 "TRCHI2DOF": "TRCHI2DOF",
                 }
    
    loki_X = dtt.X.addTupleTool("LoKi::Hybrid::TupleTool/LoKi_X")
    loki_X.Variables = x_vars
    loki_X.Preambulo = x_preamble
    
    loki_mup = dtt.muplus.addTupleTool("LoKi::Hybrid::TupleTool/LoKi_MuPlus")
    loki_mup.Variables = muon_vars
    #dtt.muplus.addTupleTool("TupleToolGeometry")
    
    loki_mum = dtt.muminus.addTupleTool("LoKi::Hybrid::TupleTool/LoKi_MuMinus")
    loki_mum.Variables = muon_vars
    #dtt.muminus.addTupleTool("TupleToolGeometry")
    
    dv.TupleFile = "DVNtuples.root"
    if turbo:
        dv.UserAlgorithms = [assoc_seq, dtt]

    else:
        assocpp = ChargedPP2MC("TimsChargedPP2MC")
        assocpp.OutputLevel = 1
        dv.UserAlgorithms = [jpsi_seq.sequence(), assocpp, dtt]
Exemplo n.º 2
0
    def configure_tools(self, toolList = ["TupleToolPropertime",
                                          "TupleToolKinematic",
                                          "TupleToolGeometry",
                                          "TupleToolEventInfo",
                                          "TupleToolPrimaries",
                                          "TupleToolPid",
                                          "TupleToolANNPID",
                                          "TupleToolTrackInfo",
                                          "TupleToolRecoStats",],
                        mcToolList = ['TupleToolMCTruth',
                                      'TupleToolMCBackgroundInfo',
                                      'MCTupleToolPrompt'],
                        L0List = [],
                        HLT1List = [],
                        HLT2List = [],
                        strippingList = [],
                        headBranch = None,
                        isTrigger = False) :

        for trigList in L0List, HLT1List, HLT2List, strippingList :
            for i, trig in enumerate(trigList) :
                if trig[-8:] != 'Decision' :
                    trigList[i] += 'Decision'

        for tool in toolList :
            self.addTupleTool(tool)
        if mcToolList :
            ttmc = self.addTupleTool('TupleToolMCTruth')
            for tool in mcToolList :
                if tool == 'TupleToolMCTruth' :
                    continue
                if tool.find('MCTupleTool') == 0 :
                    ttmc.addTupleTool(tool)
                else :
                    self.addTupleTool(tool)
 
        if isTrigger :
            # Is this right? Or should I pass it the list of sub-tools of TupleToolMCTruth?
            relations = TeslaTruthUtils.getRelLoc('')
            TeslaTruthUtils.makeTruth(self,
                                      [relations],
                                      mcToolList)

        if strippingList :
            ttstrip = self.addTupleTool('TupleToolStripping')
            ttstrip.TriggerList = strippingList
            ttstrip.VerboseStripping = True
            
            # This doesn't currently work. There doesn't seem to be an easy way
            # to TISTOS stripping lines currently, which is infuriating. Surely everyone
            # needs to do this for MC studies? It might be possible to do it using 
            # TESTisTos in a Bender algorithm, or INTES functor.
            #ttstriptistos = headBranch.addTupleTool('TupleToolTISTOS/tistos_stripping')
            #ttstriptistos.TriggerTisTosName = 'TESTisTos'
            #ttstriptistos.TriggerList = [os.path.join(rootInTES, inputLocation)]

        if L0List or HLT1List or HLT2List :
            if headBranch == None :
                headBranch = self
            ttrig = headBranch.addTupleTool('TupleToolTISTOS')
            # TupleToolTISTOS can't do stripping this way either.
            ttrig.TriggerList = L0List + HLT1List + HLT2List 
            ttrig.Verbose = True
            ttrig.VerboseL0 = True
            ttrig.VerboseHlt1 = True
            ttrig.VerboseHlt2 = True
tuple.Decay = "J/psi(1S) -> ^mu+ ^mu-"
#tuple.Decay = "[D*(2010)+ -> ^(K*(892)0 -> ^K+ ^pi-) ^pi+]CC"

tuple.addTool(TupleToolTrigger, name="TupleToolTrigger")
tuple.addTool(TupleToolTISTOS, name="TupleToolTISTOS")
# Get trigger info
tuple.TupleToolTrigger.Verbose = True
tuple.TupleToolTrigger.TriggerList = tlist
tuple.TupleToolTISTOS.Verbose = True
tuple.TupleToolTISTOS.TriggerList = tlist

from TeslaTools import TeslaTruthUtils
seq = TeslaTruthUtils.associateSequence("Tesla", False)
relations = TeslaTruthUtils.getRelLoc("Tesla")
TeslaTruthUtils.makeTruth(
    tuple, relations,
    ["MCTupleToolKinematic", "MCTupleToolHierarchy", "MCTupleToolPID"])

tuple2 = MCDecayTreeTuple("MCTeslaTuple")
tuple2.Inputs = ['/Event/Tesla/Particles']
tuple2.Decay = tuple.Decay

from Configurables import DataOnDemandSvc, L0SelReportsMaker, L0DecReportsMaker
DataOnDemandSvc().AlgMap["HltLikeL0/DecReports"] = L0DecReportsMaker()
DataOnDemandSvc().AlgMap["HltLikeL0/SelReports"] = L0SelReportsMaker()
from Configurables import L0Conf
L0Conf().FullL0MuonDecoding = True
L0Conf().EnableL0DecodingOnDemand = True
L0Conf().EnsureKnownTCK = False

tuple3 = DecayTreeTuple("StrippingTuple")
Exemplo n.º 4
0
    def configure_tools(self, toolList = ["TupleToolPropertime",
                                          "TupleToolKinematic",
                                          "TupleToolGeometry",
                                          "TupleToolEventInfo",
                                          "TupleToolPrimaries",
                                          "TupleToolPid",
                                          "TupleToolANNPID",
                                          "TupleToolTrackInfo",
                                          "TupleToolRecoStats",],
                        mcToolList = ['TupleToolMCTruth',
                                      'TupleToolMCBackgroundInfo',
                                      'MCTupleToolPrompt'],
                        L0List = [],
                        HLT1List = [],
                        HLT2List = [],
                        strippingList = [],
                        headBranch = None,
                        isTrigger = False) :

        for trigList in L0List, HLT1List, HLT2List, strippingList :
            for i, trig in enumerate(trigList) :
                if trig[-8:] != 'Decision' :
                    trigList[i] += 'Decision'

        for tool in toolList :
            self.addTupleTool(tool)
        if mcToolList :
            ttmc = self.addTupleTool('TupleToolMCTruth')
            for tool in mcToolList :
                if tool == 'TupleToolMCTruth' :
                    continue
                if tool.find('MCTupleTool') == 0 :
                    ttmc.addTupleTool(tool)
                else :
                    self.addTupleTool(tool)
 
        if isTrigger and mcToolList :
            # Is this right? Or should I pass it the list of sub-tools of TupleToolMCTruth?
            hlt2line = self.Inputs[0].split('/')[-2]
            # Need this for 2015
            #relations = TeslaTruthUtils.getRelLoc(hlt2line + '/')
            # This for 2016 ...
            relations = TeslaTruthUtils.getRelLoc('')
            TeslaTruthUtils.makeTruth(self,
                                      [relations],
                                      ttmc.ToolList)

        if strippingList :
            ttstrip = self.addTupleTool('TupleToolStripping')
            ttstrip.TriggerList = strippingList
            ttstrip.VerboseStripping = True
            
            # This doesn't currently work. There doesn't seem to be an easy way
            # to TISTOS stripping lines currently, which is infuriating. Surely everyone
            # needs to do this for MC studies? It might be possible to do it using 
            # TESTisTos in a Bender algorithm, or INTES functor.
            #ttstriptistos = headBranch.addTupleTool('TupleToolTISTOS/tistos_stripping')
            #ttstriptistos.TriggerTisTosName = 'TESTisTos'
            #ttstriptistos.TriggerList = [os.path.join(rootInTES, inputLocation)]

        if L0List or HLT1List or HLT2List :
            if headBranch == None :
                headBranch = self
            ttrig = headBranch.addTupleTool('TupleToolTISTOS')
            # TupleToolTISTOS can't do stripping this way either.
            ttrig.TriggerList = L0List + HLT1List + HLT2List 
            ttrig.Verbose = True
            ttrig.VerboseL0 = True
            ttrig.VerboseHlt1 = True
            ttrig.VerboseHlt2 = True
tuple.Decay = "J/psi(1S) -> ^mu+ ^mu-"
#tuple.Decay = "[D*(2010)+ -> ^(K*(892)0 -> ^K+ ^pi-) ^pi+]CC"

tuple.addTool(TupleToolTrigger, name="TupleToolTrigger")
tuple.addTool(TupleToolTISTOS, name="TupleToolTISTOS")
# Get trigger info
tuple.TupleToolTrigger.Verbose = True
tuple.TupleToolTrigger.TriggerList = tlist
tuple.TupleToolTISTOS.Verbose = True
tuple.TupleToolTISTOS.TriggerList = tlist

from TeslaTools import TeslaTruthUtils
seq = TeslaTruthUtils.associateSequence("Tesla",False)
relations = TeslaTruthUtils.getRelLoc("Tesla")
TeslaTruthUtils.makeTruth(tuple, relations, [ "MCTupleToolKinematic" , "MCTupleToolHierarchy" , "MCTupleToolPID" ])

tuple2 = MCDecayTreeTuple("MCTeslaTuple")
tuple2.Inputs = ['/Event/Tesla/Particles']
tuple2.Decay = tuple.Decay

from Configurables import DataOnDemandSvc, L0SelReportsMaker, L0DecReportsMaker
DataOnDemandSvc().AlgMap["HltLikeL0/DecReports"] = L0DecReportsMaker()
DataOnDemandSvc().AlgMap["HltLikeL0/SelReports"] = L0SelReportsMaker()
from Configurables import L0Conf
L0Conf().FullL0MuonDecoding = True
L0Conf().EnableL0DecodingOnDemand = True
L0Conf().EnsureKnownTCK=False

tuple3 = DecayTreeTuple("StrippingTuple")
tuple3.Inputs = ['/Event/AllStreams/Phys/FullDSTDiMuonJpsi2MuMuDetachedLine/Particles']
Exemplo n.º 6
0
def execute(simulation=True,
            turbo=True,
            decay_descriptor="J/psi(1S) -> mu- mu+"):
    # Configure all the unpacking, algorithms, tags and input files
    appConf = ApplicationMgr()
    appConf.ExtSvc += ['ToolSvc', 'DataOnDemandSvc', LoKiSvc()]

    ConfigTarFileAccessSvc().File = 'config.tar'

    dv = DaVinci()
    dv.DataType = "2012"

    lhcbApp = LHCbApp()
    lhcbApp.Simulation = simulation
    CondDB().Upgrade = False

    dtt = DecayTreeTuple("Early2015")
    if turbo:
        tesla_prefix = "Hlt2DiMuonJPsi"
        dtt.Inputs = ["/Event/" + tesla_prefix + "/Particles"]
        dtt.InputPrimaryVertices = "/Event/" + tesla_prefix + "/Primary"
        dtt.WriteP2PVRelations = False

    else:
        LHCbApp().DDDBtag = "dddb-20140729"
        polarity = "u"
        LHCbApp().CondDBtag = "sim-20140730-vc-m%s100" % polarity
        muons = AutomaticData(Location="Phys/StdAllLooseMuons/Particles")

        jpsi = CombineParticles('MyJPsi')
        jpsi.DecayDescriptors = [decay_descriptor]
        jpsi.CombinationCut = "(AM < 7100.0 *GeV)"
        jpsi.DaughtersCuts = {"": "ALL", "mu+": "ALL", "mu-": "ALL"}
        jpsi.MotherCut = "(VFASPF(VCHI2/VDOF) < 999999.0)"

        code = """
('J/psi(1S)' == ID) &
in_range(2.990*GeV, M, 3.210*GeV) &
DECTREE('%s') &
CHILDCUT(1, HASMUON & ISMUON) &
CHILDCUT(2, HASMUON & ISMUON) &
(MINTREE('mu+' == ABSID, PT) > 700*MeV) &
(MAXTREE(ISBASIC & HASTRACK, TRCHI2DOF) < 5) &
(MINTREE(ISBASIC & HASTRACK, CLONEDIST) > 5000) &
(VFASPF(VPCHI2) > 0.5/100) &
(abs(BPV(VZ)) <  0.5*meter) &
(BPV(vrho2) < (10*mm)**2)
""" % (decay_descriptor)
        # similar to the HLT2 line
        code = """
(ADMASS('J/psi(1S)')< 120*MeV) &
DECTREE('%s') &
(PT>0*MeV) &
(MAXTREE('mu-'==ABSID,TRCHI2DOF) < 4) &
(MINTREE('mu-'==ABSID,PT)> 0*MeV) &
(VFASPF(VCHI2PDOF)< 25)
""" % (decay_descriptor)
        filter_jpsi = FilterDesktop(
            "MyFilterJPsi",
            Code=code,
            Preambulo=["vrho2 = VX**2 + VY**2"],
            ReFitPVs=True,
            #IgnoreP2PVFromInputLocations=True,
            #WriteP2PVRelations=True
        )

        jpsi_sel = Selection("SelMyJPsi",
                             Algorithm=jpsi,
                             RequiredSelections=[muons])
        filter_jpsi_sel = Selection("SelFilterMyJPsi",
                                    Algorithm=filter_jpsi,
                                    RequiredSelections=[jpsi_sel])
        jpsi_seq = SelectionSequence("SeqMyJPsi", TopSelection=filter_jpsi_sel)
        dtt.Inputs = [jpsi_seq.outputLocation()]

    # Overwriting default list of TupleTools
    dtt.ToolList = [
        "TupleToolKinematic",
        "TupleToolPid",
        "TupleToolEventInfo",
        "TupleToolMCBackgroundInfo",
        "TupleToolMCTruth",
        #"MCTupleToolHierarchy",
        #"MCTupleToolPID",
        "TupleToolGeometry",
        "TupleToolTISTOS",
        # with turbo this crashes
        #"TupleToolTrackInfo",
        "TupleToolTrigger",
    ]
    tlist = [
        "L0HadronDecision",
        "L0MuonDecision",
        "L0DiMuonDecision",
        "L0ElectronDecision",
        "L0PhotonDecision",
        "Hlt1DiMuonHighMassDecision",
        "Hlt1DiMuonLowMassDecision",
        "Hlt1TrackMuonDecision",
        "Hlt1TrackAllL0Decision",
        "Hlt2DiMuonJPsiDecision",
        "Hlt2SingleMuonDecision",
    ]

    dtt.addTool(TupleToolTrigger, name="TupleToolTrigger")
    dtt.addTool(TupleToolTISTOS, name="TupleToolTISTOS")
    # Get trigger info
    dtt.TupleToolTrigger.Verbose = True
    dtt.TupleToolTrigger.TriggerList = tlist
    dtt.TupleToolTISTOS.Verbose = True
    dtt.TupleToolTISTOS.TriggerList = tlist

    from Configurables import TupleToolMCTruth, MCTupleToolHierarchy
    dtt.addTool(TupleToolMCBackgroundInfo, name="TupleToolMCBackgroundInfo")
    dtt.TupleToolMCBackgroundInfo.Verbose = True
    dtt.addTool(MCTupleToolHierarchy, name="MCTupleToolHierarchy")
    dtt.MCTupleToolHierarchy.Verbose = True
    dtt.addTool(TupleToolMCTruth, name="TupleToolMCTruth")
    dtt.TupleToolMCTruth.Verbose = True

    if turbo:
        assoc_seq = TeslaTruthUtils.associateSequence(tesla_prefix, False)
        ChargedPP2MC(tesla_prefix + "ProtoAssocPP").OutputLevel = 1

        assoc_seq.Members.insert(0, PatLHCbID2MCParticle())

        from Configurables import MuonCoord2MCParticleLink
        muon_coords = MuonCoord2MCParticleLink("TeslaMuonCoordLinker")
        assoc_seq.Members.insert(1, muon_coords)

        TrackAssociator("TeslaAssocTr").DecideUsingMuons = True

        relations = TeslaTruthUtils.getRelLoc(tesla_prefix)

    else:
        relations = "Relations/Rec/ProtoP/Charged"

    TeslaTruthUtils.makeTruth(dtt, relations, [
        "MCTupleToolKinematic",
        "MCTupleToolHierarchy",
        "MCTupleToolPID",
    ])

    dtt.Decay = mark(2, mark(3, decay_descriptor))  #"J/psi(1S) -> ^mu- ^mu+"

    dtt.addBranches({
        "X": "^(%s)" % (decay_descriptor),
        "muplus": mark(3, decay_descriptor),  #"J/psi(1S) -> mu- ^mu+",
        "muminus": mark(2, decay_descriptor),  #"J/psi(1S) -> ^mu- mu+",
    })

    x_preamble = [
        "DZ = VFASPF(VZ) - BPV(VZ)",
    ]
    x_vars = {
        "ETA": "ETA",
        "Y": "Y",
        "PHI": "PHI",
        "VPCHI2": "VFASPF(VPCHI2)",
        "DELTAZ": "DZ",
        # DZ * M / PZ / c with c in units of mm/s
        # XXX should this be the PDG mass or measured mass?
        #"TZ": "DZ*M / PZ / 299792458000.0", #seconds
        "TZ": "DZ*3096.916 / PZ/299792458000.0*(10**12)",  #ps
        "minpt": "MINTREE('mu+' == ABSID, PT)",
        "minclonedist": "MINTREE(ISBASIC & HASTRACK, CLONEDIST)",
        "maxtrchi2dof": "MAXTREE(ISBASIC & HASTRACK, TRCHI2DOF)",
    }
    muon_vars = {
        "ETA": "ETA",
        "Y": "Y",
        "PHI": "PHI",
        "CHARGE": "Q",
        "CLONEDIST": "CLONEDIST",
        "TRCHI2DOF": "TRCHI2DOF",
    }

    loki_X = dtt.X.addTupleTool("LoKi::Hybrid::TupleTool/LoKi_X")
    loki_X.Variables = x_vars
    loki_X.Preambulo = x_preamble

    loki_mup = dtt.muplus.addTupleTool("LoKi::Hybrid::TupleTool/LoKi_MuPlus")
    loki_mup.Variables = muon_vars
    #dtt.muplus.addTupleTool("TupleToolGeometry")

    loki_mum = dtt.muminus.addTupleTool("LoKi::Hybrid::TupleTool/LoKi_MuMinus")
    loki_mum.Variables = muon_vars
    #dtt.muminus.addTupleTool("TupleToolGeometry")

    dv.TupleFile = "DVNtuples.root"
    if turbo:
        dv.UserAlgorithms = [assoc_seq, dtt]

    else:
        assocpp = ChargedPP2MC("TimsChargedPP2MC")
        assocpp.OutputLevel = 1
        dv.UserAlgorithms = [jpsi_seq.sequence(), assocpp, dtt]