TupTmp.lokiCommon.Variables['MINIP']     = "MIPDV(PRIMARY)"
TupTmp.lokiCommon.Variables['MINIPCHI2'] = "MIPCHI2DV(PRIMARY)"

TupTmp.B.InheritTools   = True
TupTmp.tau.InheritTools = True

lokiB   = LoKi__Hybrid__TupleTool("lokiB")
TupTmp.B.ToolList += ["LoKi::Hybrid::TupleTool/lokiB"]
lokitau = LoKi__Hybrid__TupleTool("lokitau")
TupTmp.tau.ToolList += ["LoKi::Hybrid::TupleTool/lokitau"]

lokiB.Variables = {
           "DOCAtauRest"  : "DOCA(1,2)",
           #"DOCAtaumu" : "DOCA(CHILD(CHILD(1),1),2)",
           #"DOCAKmu"   : "DOCA(1,3)",
           "DOCAMAX"   : "DOCAMAX",
           "BPVVDCHI2" : "BPVVDCHI2",
           "BPVVDRHO"  : "BPVVDRHO",
           "BPVVDZ"    : "BPVVDZ"
           #, "Mtaumu"    : "M23" 
           }

lokitau.Variables = {
           "DOCA12"    : "DOCA(1,2)",
           "DOCA23"    : "DOCA(2,3)",
           "DOCA13"    : "DOCA(1,3)",
           "DOCAMAX"   : "DOCAMAX",
           "BPVVDCHI2" : "BPVVDCHI2",
           "BPVVDRHO"  : "BPVVDRHO",
           "BPVVDZ"    : "BPVVDZ",
           "M12"       : "M12",
           "M23"       : "M23",
Example #2
0
    " [B0 ->  ( D0 ->  K+  K- )  ( rho(770)0 ->  pi+ ^pi- ) ]CC ",
    "rho":
    " [B0 ->  ( D0 ->  K+  K- ) ^( rho(770)0 ->  pi+  pi- ) ]CC "
})

tuple.addTupleTool("TupleToolTISTOS/TupleToolTISTOS")
tuple.TupleToolTISTOS.VerboseL0 = True
tuple.TupleToolTISTOS.VerboseHlt1 = True
tuple.TupleToolTISTOS.VerboseHlt2 = True
tuple.TupleToolTISTOS.TriggerList = myTriggerList

#Add Loki variables
LoKi_DOCA = LoKi__Hybrid__TupleTool("LoKi_DOCA")
LoKi_DOCA.Variables = {
    "MAXDOCA": "LoKi.Particles.PFunA(AMAXDOCA('LoKi::TrgDistanceCalculator'))",
    "MINDOCA": "LoKi.Particles.PFunA(AMINDOCA('LoKi::TrgDistanceCalculator'))",
    "DOCA12": "LoKi.Particles.PFunA(ADOCA(1,2))"
}

LoKi_LT = LoKi__Hybrid__TupleTool("LoKi_LT")
LoKi_LT.Variables = {
    "LT_FITCHI2": "BPVLTFITCHI2()",
    "LT": "BPVLTIME()",
    "LT_CHI2": "BPVLTCHI2()"
}

LoKi_Iso = LoKi__Hybrid__TupleTool('LoKi_Iso')
LoKi_Iso.Variables = {
    "LOKI_CONE1ANGLE": "INFO(9000, 0.)",
    "LOKI_CONE1MULT": "INFO(9000+1, 0.)",
    "LOKI_CONE1PASY": "INFO(9000+10, 0.)",
Example #3
0
tuple.addTool(TupleToolDecay, name="Bs")
tuple.Bs.ToolList = [ "TupleToolPropertime" ]
tuple.addTool(TupleToolDecay, name="J_psi_1S")

tuple.Bs.addTool(tistos)
tuple.Bs.ToolList+=["TupleToolTISTOS/tistos"]
tuple.J_psi_1S.addTool(tistos)
tuple.J_psi_1S.ToolList+=["TupleToolTISTOS/tistos"]
tuple.ReFitPVs = True
LoKi_Bs=LoKi__Hybrid__TupleTool("LoKi_Bs")
LoKi_Bs.Variables =  { 
#        "LOKI_FDCHI2"     : "BPVVDCHI2", 
#        "LOKI_FDS"        : "BPVDLS", 
#        "LOKI_DIRA"       : "BPVDIRA" , 
        "LOKI_DTF_CTAU"        : "DTF_CTAU( 0, True )", 
#        "LOKI_DTF_CTAUS"       : "DTF_CTAUSIGNIFICANCE( 0, True )", 
        "LOKI_DTF_CHI2NDOF"    : "DTF_CHI2NDOF( True )", 
        "LOKI_DTF_CTAUERR"     : "DTF_CTAUERR( 0, True )", 
        "LOKI_MASS_JpsiConstr" : "DTF_FUN ( M , True , 'J/psi(1S)' )" , 
        "LOKI_DTF_VCHI2NDOF"   : "DTF_FUN ( VFASPF(VCHI2/VDOF) , True  )"  
        } 
tuple.Bs.addTool(LoKi_Bs)         
tuple.Bs.ToolList+=["LoKi::Hybrid::TupleTool/LoKi_Bs"] 

from Configurables import LoKi__Hybrid__EvtTupleTool as LoKiTool
tuple.addTool(LoKiTool , 'MyLoKiTool' )
tuple.ToolList += [ "LoKi::Hybrid::EvtTupleTool/MyLoKiTool" ]
tuple.MyLoKiTool.VOID_Variables = {    'nTracks' :  " CONTAINS ('Rec/Track/Best') "  ,
                                        "nLong"  :   " TrSOURCE('Rec/Track/Best', TrLONG) >> TrSIZE "
                                          }
tuple.MyLoKiTool.Preambulo = [
    ,'Hlt2DiMuonDY4Decision'
    ,'Hlt2DiMuonDetachedDecision'
    ,'Hlt2DiMuonDetachedHeavyDecision'
    ,'Hlt2DiMuonBDecision'

    ,'Hlt2DiMuonLowMassDecision'
    ,'Hlt2DiMuonDecision'
    ,'Hlt2CharmSemilepD2HMuMuDecision'
    ,'Hlt2CharmSemilepD2HMuMuWideMassDecision'
  ]

LoKi_Vars = LoKi__Hybrid__TupleTool("LoKi_Vars")
LoKi_Vars.Variables =  {

    "LoKi_BPVVDCHI2"    : "BPVVDCHI2"    
    , "LoKi_BPVIPCHI2"    : "BPVIPCHI2()"
    , "LoKi_DOCA"         : "DOCA(1,2)"
    , "LoKi_BPVLTIME"     : "BPVLTIME()"

    }

D2PimumuOSTuple = tuple.clone("D2PimumuOSTuple") 
D2PimumuOSTuple.Inputs = [ PiMuMuOSlocation ] 
D2PimumuOSTuple.Decay = "[D+ -> ^pi+ ^mu+ ^mu-]CC" 
D2PimumuOSTuple.Branches = { "D" :  "[D+ -> pi+ mu+ mu-]CC"} 

D2PimumuOSTuple.addTool(TupleToolDecay, name="D+") 
D2PimumuOSTuple.P2PVInputLocations = ["Phys/D2XMuMu_PiOSLine/Particle2VertexRelations"]

#----------------------------------------                                                                
# 2) Run within DaVinci                                                 
#----------------------------------------
Example #5
0
tuple.R.TupleToolMCTruth.ToolList = [ "MCTupleToolHierarchy" ]

tuple.addTool(TupleToolDecay, name="J_psi_1S")

tuple.Bs.addTool(tistos)
tuple.Bs.ToolList+=["TupleToolTISTOS/tistos"]
tuple.J_psi_1S.addTool(tistos)
tuple.J_psi_1S.ToolList+=["TupleToolTISTOS/tistos"]
tuple.ReFitPVs = True
LoKi_Bs=LoKi__Hybrid__TupleTool("LoKi_Bs")
LoKi_Bs.Variables =  { 
#        "LOKI_FDCHI2"     : "BPVVDCHI2", 
#        "LOKI_FDS"        : "BPVDLS", 
#        "LOKI_DIRA"       : "BPVDIRA" , 
        "LOKI_DTF_CTAU"        : "DTF_CTAU( 0, True )", 
#        "LOKI_DTF_CTAUS"       : "DTF_CTAUSIGNIFICANCE( 0, True )", 
        "LOKI_DTF_CHI2NDOF"    : "DTF_CHI2NDOF( True )", 
        "LOKI_DTF_CTAUERR"     : "DTF_CTAUERR( 0, True )", 
        "LOKI_MASS_JpsiConstr" : "DTF_FUN ( M , True , 'J/psi(1S)' )" , 
#        "LOKI_DTF_VCHI2NDOF"   : "DTF_FUN ( VFASPF(VCHI2/VDOF) , True  )"  #Michael commented
        } 
tuple.Bs.addTool(LoKi_Bs)         
tuple.Bs.ToolList+=["LoKi::Hybrid::TupleTool/LoKi_Bs"] 

#WM tool to cut away KS
tuple.addTool(TupleToolDecay, name="R")

LoKi_R=LoKi__Hybrid__TupleTool("LoKi_R")
LoKi_R.Variables =  {
    "WM" : "WM( 'pi+' , 'pi-')"
    }
Example #6
0
    ,'Hlt2DiMuonDY4Decision'
    ,'Hlt2DiMuonDetachedDecision'
    ,'Hlt2DiMuonDetachedHeavyDecision'
    ,'Hlt2DiMuonBDecision'

    ,'Hlt2DiMuonLowMassDecision'
    ,'Hlt2DiMuonDecision'
    ,'Hlt2CharmSemilepD2HMuMuDecision'
    ,'Hlt2CharmSemilepD2HMuMuWideMassDecision'

  ]

LoKi_Vars = LoKi__Hybrid__TupleTool("LoKi_Vars")
LoKi_Vars.Variables =  {
            "LoKi_BPVVDCHI2"    : "BPVVDCHI2"
          , "LoKi_BPVIPCHI2"    : "BPVIPCHI2()"
          , "LoKi_DOCA"         : "DOCA(1,2)"
          , "LoKi_BPVLTIME"     : "BPVLTIME()"
          }


dtt.addBranches({"D" :  "[D+ -> K+ mu+ mu-]CC"} )

from Configurables import DaVinci

# Configure DaVinci
DaVinci().UserAlgorithms += [dtt]
DaVinci().InputType = 'DST'
DaVinci().TupleFile = 'MCDKmumu12-Up.root'
DaVinci().PrintFreq = 1000
DaVinci().DataType = '2012'
DaVinci().Simulation = True
Example #7
0
]
TISTOSTool = TupleToolTISTOS('TISTOSTool')
TISTOSTool.VerboseL0   = True
TISTOSTool.VerboseHlt1 = True
TISTOSTool.VerboseHlt2 = True
TISTOSTool.TriggerList = triglist[:]
TISTOSTool.addTool( TriggerTisTos, name="TriggerTisTos")

LoKi_B0 = LoKi__Hybrid__TupleTool("LoKi_B0")
LoKi_B0.Variables =  {
      "ETA"                    : "ETA"
    , "PHI"                    : "PHI"
    , "FDCHI2"                 : "BPVVDCHI2"
    , "BPVDLS"                 : "BPVDLS"  # decay length significance to the best PV
    , "DIRA"                   : "BPVDIRA"
    , "DTF_CTAU"               : "DTF_CTAU( 0, True )"
    , "DTF_CTAUS"              : "DTF_CTAUSIGNIFICANCE( 0, True )"
    , "DTF_CHI2NDOF"           : "DTF_CHI2NDOF( True )"
    , "DTF_CTAUERR"            : "DTF_CTAUERR( 0, True )"
    , "DTF_MASS_constr"        : "DTF_FUN ( M , True , strings(['J/psi(1S)', 'pi0']) )"
    , "DTF_VCHI2NDOF"          : "DTF_FUN ( VFASPF(VCHI2/VDOF) , True )"
    }

LoKi_Jpsi = LoKi__Hybrid__TupleTool("LoKi_Jpsi")
LoKi_Jpsi.Variables =  {
      "BPVDLS"                 : "BPVDLS"  # decay length significance to the best PV
    }

LoKi_Mu = LoKi__Hybrid__TupleTool("LoKi_Mu")
LoKi_Mu.Variables =  {
    "NSHAREDMU" : "NSHAREDMU"
Example #8
0
]
TISTOSTool = TupleToolTISTOS('TISTOSTool')
TISTOSTool.VerboseL0   = True
TISTOSTool.VerboseHlt1 = True
TISTOSTool.VerboseHlt2 = True
TISTOSTool.TriggerList = triglist[:]
TISTOSTool.addTool( TriggerTisTos, name="TriggerTisTos")

LoKi_B = LoKi__Hybrid__TupleTool("LoKi_B")
LoKi_B.Variables =  {
        "ETA" : "ETA",
        "PHI" : "PHI",
    "FDCHI2"          : "BPVVDCHI2",
    "FDS"             : "BPVDLS",
    "DIRA"            : "BPVDIRA",
    "DTF_CTAU"        : "DTF_CTAU( 0, True )",
    "DTF_CTAUS"       : "DTF_CTAUSIGNIFICANCE( 0, True )",
    "DTF_CHI2NDOF"    : "DTF_CHI2NDOF( True )",
    "DTF_CTAUERR"     : "DTF_CTAUERR( 0, True )",
    "DTF_MASS_constr1"  : "DTF_FUN ( M , True , strings(['J/psi(1S)']) )" ,
    "DTF_MASS_constr2"  : "DTF_FUN ( M , True , strings(['psi(2S)']) )" ,
    "DTF_VCHI2NDOF"     : "DTF_FUN ( VFASPF(VCHI2/VDOF) , True )",
    }

LoKi_Mu = LoKi__Hybrid__TupleTool("LoKi_Mu")
LoKi_Mu.Variables =  {
    "NSHAREDMU" : "NSHAREDMU"
    }

tuple_B2Kmumu = DecayTreeTuple("Tuple")
tuple_B2Kmumu.Inputs = [ location ]
tuple_B2Kmumu.ToolList = tupletools[:]
Example #9
0
]
TISTOSTool = TupleToolTISTOS('TISTOSTool')
TISTOSTool.VerboseL0 = True
TISTOSTool.VerboseHlt1 = True
TISTOSTool.VerboseHlt2 = True
TISTOSTool.TriggerList = triglist[:]
TISTOSTool.addTool(TriggerTisTos, name="TriggerTisTos")

LoKi_B = LoKi__Hybrid__TupleTool("LoKi_B")
LoKi_B.Variables = {
    "ETA": "ETA",
    "PHI": "PHI",
    "FDCHI2": "BPVVDCHI2",
    "FDS": "BPVDLS",
    "DIRA": "BPVDIRA",
    "DTF_CTAU": "DTF_CTAU( 0, True )",
    "DTF_CTAUS": "DTF_CTAUSIGNIFICANCE( 0, True )",
    "DTF_CHI2NDOF": "DTF_CHI2NDOF( True )",
    "DTF_CTAUERR": "DTF_CTAUERR( 0, True )",
    "DTF_MASS_constr1": "DTF_FUN ( M , True , strings(['J/psi(1S)']) )",
    "DTF_MASS_constr2": "DTF_FUN ( M , True , strings(['psi(2S)']) )",
    "DTF_VCHI2NDOF": "DTF_FUN ( VFASPF(VCHI2/VDOF) , True )",
}

LoKi_Mu = LoKi__Hybrid__TupleTool("LoKi_Mu")
LoKi_Mu.Variables = {"NSHAREDMU": "NSHAREDMU"}

tuple_B2Kmumu = DecayTreeTuple("Tuple")
tuple_B2Kmumu.Inputs = [location]
tuple_B2Kmumu.ToolList = tupletools[:]
tuple_B2Kmumu.Decay = '[B0 -> ^(J/psi(1S) -> ^mu+ ^mu-) ^(omega(782) -> ^pi+ ^pi- ^pi0)]CC'
tuple_B2Kmumu.Branches = {
streams = get_streams(strippingVersion)


dtt = DecayTreeTuple('Dst2010ToD0ToKpipiTuple', Inputs = ['/Event/AllStreams/Phys/D2hhPromptDst2D2RSLine/Particles'], Decay = '[D*(2010)+ -> (D0 -> K- pi+) pi+]CC')
ttmc = dtt.addTupleTool('TupleToolMCTruth')
ttmc.ToolList += ['MCTupleToolPrompt']
ttmc.ToolList += ['MCTupleToolHierarchy']
dtt.ToolList += ['TupleToolMCTruth',
                 #'TupleToolGeneration'
                 'TupleToolMCBackgroundInfo'
                 ]
dtfVars = {
    # Index 0 for CHILDFUN meas the particle itself, so 1 is the D0.
    "DTF_M_D0_BPVIPCHI2"  : "DTF_FUN(CHILDFUN(BPVIPCHI2(), 1), False, 'D0')"
    }

decayDesc = dtt.Decay.replace('^', '')
dtt.addBranches({'Dst' : decayDesc})
dstLoKiTuple = LoKi__Hybrid__TupleTool('DstLoKiTuple')
dstLoKiTuple.Variables = dtfVars
dtt.Dst.ToolList += [ "LoKi::Hybrid::TupleTool/DstLoKiTuple" ]
dtt.Dst.addTool(dstLoKiTuple)
dtt.Dst.InheritTools = True

dv = DaVinci('DaVinci', DataType = '2011', TupleFile = 'DVTuples.root', HistogramFile = 'DVHistos.root', UserAlgorithms = [dtt], Lumi = True, DDDBtag = 'Sim08-20130503', CondDBtag = 'Sim08-20130503-vc-md100', Simulation = True)

FileCatalog().Catalogs = ["xmlcatalog_file:/afs/cern.ch/work/m/malexand//charm/2011/data/mc/pool_xml_catalog.xml"]

dv.EvtMax = 1000

Example #11
0
def ConfigureTuples():
    from JetAccessoriesMC.ConfigurationHelpers import ConfigureDoD
    tables = ConfigureDoD()
    from Configurables import TupleToolJetRelations, DecayTreeTuple
    HepMCAllJetTuple = DecayTreeTuple("HepMCAllJetTuple")

    HepMCAllJetTuple.InputLocations = ['Phys/StdHepMCAllJets/Particles']
    HepMCAllJetTuple.Decay = "CELLjet"
    HepMCAllJetTuple.ToolList = [
        'TupleToolKinematic', 'TupleToolEventInfo',
        'LoKi__Hybrid__TupleTool/LoKiTool'
    ]
    from JetAccessoriesMC.ConfigurationHelpers import addRelationTuple

    addRelationTuple(HepMCAllJetTuple,
                     tables['StdHepMCAllJetsPartonic'],
                     InvertTable=True,
                     ReverseMatching=True)
    addRelationTuple(HepMCAllJetTuple,
                     tables['StdHepMCAllJetsPartonic'],
                     InvertTable=True,
                     ReverseMatching=False)

    addRelationTuple(HepMCAllJetTuple,
                     tables['StdHepMCJets2StdJetsDeltaR'],
                     InvertTable=False,
                     ReverseMatching=True,
                     extraName='DeltaR')
    addRelationTuple(HepMCAllJetTuple,
                     tables['StdHepMCJets2StdJetsDeltaR'],
                     InvertTable=False,
                     ReverseMatching=False,
                     extraName='DeltaR')

    addRelationTuple(HepMCAllJetTuple,
                     tables['StdHepMCAllJets2StdJetsmeasured'],
                     InvertTable=False,
                     ReverseMatching=True)
    addRelationTuple(HepMCAllJetTuple,
                     tables['StdHepMCAllJets2StdJetsmeasured'],
                     InvertTable=False,
                     ReverseMatching=False)
    addRelationTuple(HepMCAllJetTuple,
                     tables['StdHepMCAllJets2StdJetsMCtrue'],
                     InvertTable=False,
                     ReverseMatching=True)
    addRelationTuple(HepMCAllJetTuple,
                     tables['StdHepMCAllJets2StdJetsMCtrue'],
                     InvertTable=False,
                     ReverseMatching=False)

    from Configurables import LoKi__Hybrid__TupleTool
    LoKiTool = LoKi__Hybrid__TupleTool('LoKiTool')
    LoKiTool.Variables = {"ETA": "ETA", "PHI": "PHI", "Y": "Y"}
    HepMCAllJetTuple.addTool(LoKiTool)
    DaVinci().UserAlgorithms += [HepMCAllJetTuple]

    HepMCJetTuple = DecayTreeTuple("HepMCJetTuple")  #,OutputLevel = VERBOSE)
    HepMCJetTuple.InputLocations = ['Phys/StdHepMCJets/Particles']
    HepMCJetTuple.Decay = "CELLjet"
    HepMCJetTuple.ToolList = [
        'TupleToolKinematic', 'TupleToolEventInfo',
        'LoKi__Hybrid__TupleTool/LoKiTool'
    ]

    addRelationTuple(HepMCJetTuple,
                     tables['StdHepMCJets2StdJetsmeasured'],
                     InvertTable=False,
                     ReverseMatching=True,
                     extraName='Measured')
    HepMCJetTuple.StdHepMCJets2StdJetsRevMeasured.ExtraWeights = {
        'OverlapMeasured': tables['StdHepMCJets2StdJetsmeasured'].OutputTable,
        'OverlapMCtrue': tables['StdHepMCJets2StdJetsMCtrue'].OutputTable
    }

    addRelationTuple(HepMCJetTuple,
                     tables['StdHepMCJets2StdJetsMCtrue'],
                     InvertTable=False,
                     ReverseMatching=True,
                     extraName='MCtrue')
    HepMCJetTuple.StdHepMCJets2StdJetsRevMCtrue.ExtraWeights = {
        'OverlapMeasured': tables['StdHepMCJets2StdJetsmeasured'].OutputTable,
        'OverlapMCtrue': tables['StdHepMCJets2StdJetsMCtrue'].OutputTable
    }

    addRelationTuple(HepMCJetTuple,
                     tables['StdHepMCJets2StdJetsDeltaR'],
                     InvertTable=False,
                     ReverseMatching=False,
                     extraName='DeltaR')

    HepMCJetTuple.StdHepMCJets2StdJetsDeltaR.ExtraWeights = {
        'OverlapMeasured': tables['StdHepMCJets2StdJetsmeasured'].OutputTable,
        'OverlapMCtrue': tables['StdHepMCJets2StdJetsMCtrue'].OutputTable
    }

    HepMCJetTuple.addTool(LoKiTool)
    DaVinci().UserAlgorithms += [HepMCJetTuple]
Example #12
0
tuple.addTool(TupleToolDecay, name="Bs")
tuple.Bs.ToolList = [ "TupleToolPropertime" ]
tuple.addTool(TupleToolDecay, name="J_psi_1S")

tuple.Bs.addTool(tistos)
tuple.Bs.ToolList+=["TupleToolTISTOS/tistos"]
tuple.J_psi_1S.addTool(tistos)
tuple.J_psi_1S.ToolList+=["TupleToolTISTOS/tistos"]
tuple.ReFitPVs = True
LoKi_Bs=LoKi__Hybrid__TupleTool("LoKi_Bs")
LoKi_Bs.Variables =  { 
#        "LOKI_FDCHI2"     : "BPVVDCHI2", 
#        "LOKI_FDS"        : "BPVDLS", 
#        "LOKI_DIRA"       : "BPVDIRA" , 
        "LOKI_DTF_CTAU"             : "DTF_CTAU( 0, True )", 
#        "LOKI_DTF_CTAUS"            : "DTF_CTAUSIGNIFICANCE( 0, True )", 
        "LOKI_DTF_CHI2NDOF"         : "DTF_CHI2NDOF( True )", 
        "LOKI_DTF_CTAUERR"          : "DTF_CTAUERR( 0, True )", 
        "LOKI_MASS_JpsiConstr"      : "DTF_FUN ( M , True , 'J/psi(1S)' )" , 
        "LOKI_MASS_ConstrLbtoJpsiL" : "DTF_FUN ( M , True , strings('J/psi(1S)', 'Lambda0') )",
        "LOKI_DTF_VCHI2NDOF"        : "DTF_FUN ( VFASPF(VCHI2/VDOF) , True  )"  
        } 
tuple.Bs.addTool(LoKi_Bs)
tuple.Bs.ToolList+=["LoKi::Hybrid::TupleTool/LoKi_Bs"] 

from Configurables import TupleToolAllTracks
BsAllTracks=TupleToolAllTracks("BsAllTracks")
atlocations = [  ]
# atlocations.append(SeqLb2JpsipK.outputLocation())
# atlocations.append("Phys/StdAllNoPIDsPions/Particles")
atlocations.append("Phys/StdAllNoPIDsKaons/Particles")
# BsAllTracks.ANNPIDCut = 0.3 
Example #13
0
from Gaudi.Configuration import FileCatalog
from Configurables import LoKi__Hybrid__TupleTool

FileCatalog().Catalogs = ["xmlcatalog_file:/afs/cern.ch/work/m/malexand//charm/2011/data/mc/pool_xml_catalog.xml"]

dv.EvtMax = 1000

ttmc = dtt.addTupleTool('TupleToolMCTruth')
ttmc.ToolList += ['MCTupleToolPrompt']
ttmc.ToolList += ['MCTupleToolHierarchy']
dtt.ToolList += ['TupleToolMCTruth',
                 #'TupleToolGeneration'
                 'TupleToolMCBackgroundInfo'
                 ]
dtfVars = {
    # Index 0 for CHILDFUN meas the particle itself, so 1 is the D0.
    "DTF_M_D0_BPVIPCHI2"  : "DTF_FUN(CHILDFUN(BPVIPCHI2(), 1), False, 'D0')"
    }

decayDesc = dtt.Decay.replace('^', '')
dtt.addBranches({'Dst' : decayDesc})
dstLoKiTuple = LoKi__Hybrid__TupleTool('DstLoKiTuple')
dstLoKiTuple.Variables = dtfVars
dtt.Dst.ToolList += [ "LoKi::Hybrid::TupleTool/DstLoKiTuple" ]
dtt.Dst.addTool(dstLoKiTuple)
dtt.Dst.InheritTools = True
Example #14
0
TISTOSTool = TupleToolTISTOS('TISTOSTool')
TISTOSTool.VerboseL0 = True
TISTOSTool.VerboseHlt1 = True
TISTOSTool.VerboseHlt2 = True
TISTOSTool.TriggerList = triglist[:]
TISTOSTool.addTool(TriggerTisTos, name="TriggerTisTos")

LoKi_B = LoKi__Hybrid__TupleTool("LoKi_B")
LoKi_B.Variables = {
    "Best_PV_CORRM": "BPVCORRM",
    "Best_PV_Eta": "BPVETA",
    "ETA": "ETA",
    "PHI": "PHI",
    "LOKI_FDCHI2": "BPVVDCHI2",
    "LOKI_FDS": "BPVDLS",
    "LOKI_DIRA": "BPVDIRA",
    "LOKI_DTF_CTAU": "DTF_CTAU( 0, True )",
    "LOKI_DTF_CTAUS": "DTF_CTAUSIGNIFICANCE( 0, True )",
    "LOKI_DTF_CHI2NDOF": "DTF_CHI2NDOF( True )",
    "LOKI_DTF_CTAUERR": "DTF_CTAUERR( 0, True )",
    "LOKI_MASS_JpsiConstr": "DTF_FUN ( M , False , 'J/psi(1S)' )",
    "LOKI_DTF_VCHI2NDOF": "DTF_FUN ( VFASPF(VCHI2/VDOF) , True )",
}

LoKi_psi = LoKi__Hybrid__TupleTool("LoKi_psi")
LoKi_psi.Variables = {
    "q_PV_constr_B_constr": "DTF_FUN ( M , True , 'B+' )",
    "q_PV_constr": "DTF_FUN ( M , True )",
    "q_B_constr": "DTF_FUN ( M , False , 'B+' )",
    "q_no_constr": "DTF_FUN ( M , False )",
}
BuTuple.Inputs = [BuPartVtxlocation]  #
BuTuple.Decay = Budecaydcr
BuTuple.ReFitPVs = True

TupleToolTrackPosition = TupleToolTrackPosition('TupleToolTrackPosition')
TupleToolTrackPosition.Z = 7500.
BuTuple.addTool(TupleToolTrackPosition)

TupleToolRecoStats = TupleToolRecoStats('TupleToolRecoStats')
TupleToolRecoStats.Verbose = True
BuTuple.addTool(TupleToolRecoStats)

LoKiVariables = LoKi__Hybrid__TupleTool('LoKiVariables')
LoKiVariables.Variables = {
    "LOKI_ENERGY": "E",
    "LOKI_ETA": "ETA",
    "LOKI_PHI": "PHI",
}

BuTuple.addTool(LoKiVariables, name='LoKiVariables')
BuTuple.ToolList += ['LoKi::Hybrid::TupleTool/LoKiVariables']

from Configurables import TupleToolGeometry, TupleToolTrackInfo
TupleToolGeometry = TupleToolGeometry('TupleToolGeometry')
TupleToolGeometry.RefitPVs = True
BuTuple.addTool(TupleToolGeometry)

TupleToolTrackInfo = TupleToolTrackInfo('TupleToolTrackInfo')
TupleToolTrackInfo.Verbose = True
BuTuple.addTool(TupleToolTrackInfo)
Example #16
0
tupleMuMu = DecayTreeTuple("tupleMuMu")
tupleMuMu.InputLocations = [SelSeqMuMu.outputLocation()]
tupleMuMu.Decay = "J/psi(1S) -> ^mu+ ^mu-"
tupleMuMu.ToolList += [
    "TupleToolGeometry", "TupleToolKinematic", "TupleToolPrimaries",
    "TupleToolTrackInfo", "TupleToolPid", "TupleToolEventInfo",
    "TupleToolPropertime", "LoKi::Hybrid::TupleTool/LoKiTupleMuMu"
]
from Configurables import LoKi__Hybrid__TupleTool

LoKiTupleMuMu = LoKi__Hybrid__TupleTool("LoKiTupleMuMu")
LoKiTupleMuMu.Variables = {
    "Charge": "Q",
    "DOCA": "DOCA(1,2)",
    "DOCAMAX": "DOCAMAX",
    "NetOut": "INFO(LHCb.Particle.LastGlobal+1, -999)",
    "NetProb": "INFO(LHCb.Particle.LastGlobal+2, -999)"
}
tupleMuMu.addTool(LoKiTupleMuMu)

########################################################################
#
# DaVinci
#

from Configurables import CondDB

CondDB().IgnoreHeartBeat = True
#CondDB(UseOracle = True)
#importOptions("$APPCONFIGOPTS/DisableLFC.py")
Example #17
0
LoKi_DTFMASS.Variables = {
    "DTF_CHI2"   : "DTF_CHI2( True )",
    "DTF_NDOF"   : "DTF_NDOF( True )",

    "DTF_D_M"     : "DTF_FUN ( M ,                      True )",
    "DTF_D_MM"    : "DTF_FUN ( MM ,                     True )",
    "DTF_D_P"     : "DTF_FUN ( P ,                      True )",
    "DTF_D_PT"    : "DTF_FUN ( PT ,                     True )",
    "DTF_D_PE"    : "DTF_FUN ( E ,                      True )",
    "DTF_D_PX"    : "DTF_FUN ( PX ,                     True )",
    "DTF_D_PY"    : "DTF_FUN ( PY ,                     True )",
    "DTF_D_PZ"    : "DTF_FUN ( PZ ,                     True )",

    "DTF_pi1_M"   : "DTF_FUN ( CHILD(M,1) ,             True )",
    "DTF_pi1_MM"  : "DTF_FUN ( CHILD(MM,1) ,            True )",
    "DTF_pi1_P"   : "DTF_FUN ( CHILD(P,1) ,             True )",
    "DTF_pi1_PT"  : "DTF_FUN ( CHILD(PT,1) ,            True )",
    "DTF_pi1_PE"  : "DTF_FUN ( CHILD(E,1) ,             True )",
    "DTF_pi1_PX"  : "DTF_FUN ( CHILD(PX,1) ,            True )",
    "DTF_pi1_PY"  : "DTF_FUN ( CHILD(PY,1) ,            True )",
    "DTF_pi1_PZ"  : "DTF_FUN ( CHILD(PZ,1) ,            True )",

    "DTF_pi2_M"   : "DTF_FUN ( CHILD(M,2) ,             True )",
    "DTF_pi2_MM"  : "DTF_FUN ( CHILD(MM,2) ,            True )",
    "DTF_pi2_P"   : "DTF_FUN ( CHILD(P,2) ,             True )",
    "DTF_pi2_PT"  : "DTF_FUN ( CHILD(PT,2) ,            True )",
    "DTF_pi2_PE"  : "DTF_FUN ( CHILD(E,2) ,             True )",
    "DTF_pi2_PX"  : "DTF_FUN ( CHILD(PX,2) ,            True )",
    "DTF_pi2_PY"  : "DTF_FUN ( CHILD(PY,2) ,            True )",
    "DTF_pi2_PZ"  : "DTF_FUN ( CHILD(PZ,2) ,            True )",

    "DTF_pi3_M"   : "DTF_FUN ( CHILD(M,3) ,             True )",
    "DTF_pi3_MM"  : "DTF_FUN ( CHILD(MM,3) ,            True )",
    "DTF_pi3_P"   : "DTF_FUN ( CHILD(P,3) ,             True )",
    "DTF_pi3_PT"  : "DTF_FUN ( CHILD(PT,3) ,            True )",
    "DTF_pi3_PE"  : "DTF_FUN ( CHILD(E,3) ,             True )",
    "DTF_pi3_PX"  : "DTF_FUN ( CHILD(PX,3) ,            True )",
    "DTF_pi3_PY"  : "DTF_FUN ( CHILD(PY,3) ,            True )",
    "DTF_pi3_PZ"  : "DTF_FUN ( CHILD(PZ,3) ,            True )",

    }
Example #18
0
TISTOSTool.addTool( TriggerTisTos, name="TriggerTisTos")

LoKi_B = LoKi__Hybrid__TupleTool("LoKi_B")
LoKi_B.Variables =  {
        "ETA" : "ETA",
        "PHI" : "PHI",
    "FDCHI2"          : "BPVVDCHI2",
    "FDS"             : "BPVDLS",
    "DIRA"            : "BPVDIRA",
    "DTF_CTAU"        : "DTF_CTAU( 0, True )",
    "DTF_CTAUS"       : "DTF_CTAUSIGNIFICANCE( 0, True )",
    "DTF_CHI2NDOF"    : "DTF_CHI2NDOF( True )",
    "DTF_CTAUERR"     : "DTF_CTAUERR( 0, True )",
    "DTF_MASS_constr1"  : "DTF_FUN ( M , True , strings(['J/psi(1S)']) )" ,
    "DTF_VCHI2NDOF"     : "DTF_FUN ( VFASPF(VCHI2/VDOF) , True )",
    "PX_chic1P_constr1" : "DTF_FUN ( CHILD(PX, 1) , True  , strings(['J/psi(1S)']) )",
    "PY_chic1P_constr1" : "DTF_FUN ( CHILD(PY, 1) , True  , strings(['J/psi(1S)']) )",
    "PZ_chic1P_constr1" : "DTF_FUN ( CHILD(PZ, 1) , True  , strings(['J/psi(1S)']) )",
    "PE_chic1P_constr1" : "DTF_FUN ( CHILD( E, 1) , True  , strings(['J/psi(1S)']) )",
    "PX_proton_constr1" : "DTF_FUN ( CHILD(PX, 2) , True  , strings(['J/psi(1S)']) )",
    "PY_proton_constr1" : "DTF_FUN ( CHILD(PY, 2) , True  , strings(['J/psi(1S)']) )",
    "PZ_proton_constr1" : "DTF_FUN ( CHILD(PZ, 2) , True  , strings(['J/psi(1S)']) )",
    "PE_proton_constr1" : "DTF_FUN ( CHILD( E, 2) , True  , strings(['J/psi(1S)']) )",
    "PX_kaon_constr1"   : "DTF_FUN ( CHILD(PX, 3) , True  , strings(['J/psi(1S)']) )",
    "PY_kaon_constr1"   : "DTF_FUN ( CHILD(PY, 3) , True  , strings(['J/psi(1S)']) )",
    "PZ_kaon_constr1"   : "DTF_FUN ( CHILD(PZ, 3) , True  , strings(['J/psi(1S)']) )",
    "PE_kaon_constr1"   : "DTF_FUN ( CHILD( E, 3) , True  , strings(['J/psi(1S)']) )",
    }

LoKi_Mu = LoKi__Hybrid__TupleTool("LoKi_Mu")
LoKi_Mu.Variables =  {
Example #19
0
    "R"    :  "^[Lambda0 -> p+ pi-]CC", 
    "H1"   :  "[Lambda0 -> ^p+ pi-]CC",      
    "H2"   :  "[Lambda0 -> p+ ^pi-]CC",   
}

tuple.addTool(TupleToolDecay, name="J_psi_1S")
tuple.J_psi_1S.addTool(tistos)
tuple.J_psi_1S.ToolList+=["TupleToolTISTOS/tistos"]

tuple.ReFitPVs = True

tuple.addTool(TupleToolDecay, name="R")

LoKi_R=LoKi__Hybrid__TupleTool("LoKi_R")
LoKi_R.Variables =  {
    "WM" : "WM( 'pi+' , 'pi-')"
    }
tuple.R.addTool(LoKi_R)
tuple.R.ToolList+=["LoKi::Hybrid::TupleTool/LoKi_R"]

from Configurables import LoKi__Hybrid__EvtTupleTool as LoKiTool
tuple.addTool(LoKiTool , 'MyLoKiTool' )
tuple.ToolList += [ "LoKi::Hybrid::EvtTupleTool/MyLoKiTool" ]
tuple.MyLoKiTool.VOID_Variables = {    'nTracks' :  " CONTAINS ('Rec/Track/Best') "  ,
                                        "nLong"  :   " TrSOURCE('Rec/Track/Best', TrLONG) >> TrSIZE "
                                          }
tuple.MyLoKiTool.Preambulo = [
    "from LoKiTracks.decorators import *",
    "from LoKiCore.functions import *"
    ]
Example #20
0
def parseConfiguration(
        tupleConfig,  # TupleConfig object describing sample
        tesFormat,  # Input TES with "<line>" placeholder
        mdstOutputFile,  # MicroDST output extension
        mdstOutputPrefix,  # MicroDST prefix for production
        varsByType,  # requested variables by type
        varsByName,  # requested variables by name
        eventVariables,  # event variables
        writeNullWeightCandidates=True,
        writeMuonPIDPlus=True,
        mdstInput=False,
        tupleOutput=True):
    cfg = tupleConfig
    reviveSequences = []  # mark sequences to unpack std particles
    swSequences = []  # mark sequences to apply sWeights
    filterSequences = []  # mark sequences to be written in tuples
    matchSequences = []  # mark sequences to be written in tuples
    tupleSequences = []  # mark tuple sequences
    dstSequences = []  # sequences writing (Micro)DST files

    triggerList = [
        "L0MuonDecision",
        "L0HadronDecision",
        "L0ElectronDecision",
        "Hlt1TrackMVADecision",
        "Hlt1TrackMuonDecision",
    ]

    for basicPart in ["Muons", "Pions", "Kaons", "Protons", "Electrons"]:
        location = "Phys/StdAllNoPIDs{s}/Particles".format(s=basicPart)
        reviveSequences += [
            SelectionSequence("fs_std" + basicPart,
                              TopSelection=DataOnDemand(location))
        ]

    for basicPart in [
            "DownPions", "DownKaons", "DownProtons", "DownElectrons"
    ]:
        location = "Phys/StdNoPIDs{s}/Particles".format(s=basicPart)
        reviveSequences += [
            SelectionSequence("fs_std" + basicPart,
                              TopSelection=DataOnDemand(location))
        ]

    location = "Phys/StdLooseDownMuons/Particles"
    reviveSequences += [
        SelectionSequence("fs_std" + "DownMuons",
                          TopSelection=DataOnDemand(location))
    ]

    for sample in cfg:
        ################################################################################
        ## Configure sWeighting                                                       ##
        ################################################################################
        for line in cfg[sample].InputLines:
            location = tesFormat.replace('<line>', line)
            protoLocation = location.replace('/Particles', '/Protos')

            #     swSequences+=[ProbNNcalib ("TurboProbNN" + line, protoLocation).sequence()]
            if cfg[sample].Calibration:
                swSequences += [
                    ApplySWeights(
                        "ApplySW" + sample,
                        InputTes=location,
                        sTableDir=cfg[sample].Calibration,
                        sTableName="sTableSignal",
                    )
                ]

################################################################################
## Creates filter sequences to fill nTuples                                   ##
################################################################################

        selectionName = sample
        _cut = "DECTREE ('{}')".format(cfg[sample].Decay.replace("^", ""))

        if writeNullWeightCandidates == False:
            _cut += " & ( WEIGHT != 0 ) "

        if cfg[sample].Filter:
            _cut += " & ({}) ".format(cfg[sample].Filter.cut)

        inputSelection = MergedSelection(
            "input" + selectionName,
            RequiredSelections=[
                DataOnDemand(tesFormat.replace('<line>', line))
                for line in cfg[sample].InputLines
            ],
        )

        selection = Selection(
            selectionName,
            RequiredSelections=[inputSelection],
            Algorithm=FilterDesktop("alg_" + selectionName, Code=_cut),
        )

        filterSequence = SelectionSequence("Seq" + selectionName,
                                           TopSelection=selection)

        filterSequences += [filterSequence]

        ################################################################################
        ## Creates matching selections (used to create the proper locations in mdst)  ##
        ################################################################################
        matchingSel = Selection("Match" + selectionName,
                                Algorithm=CopyAndMatchCombination(
                                    "MatchAlg" + selectionName,
                                    Downstream=cfg[sample].Downstream,
                                ),
                                RequiredSelections=[selection])

        matchingSeq = SelectionSequence("SeqMatch" + selectionName,
                                        TopSelection=matchingSel)

        matchSequences += [matchingSeq]

        partsInBranches = []

        for branchName in cfg[sample].Branches:

            partName = branchName
            if len(cfg[sample].Branches[branchName].isAlso) > 0:
                partName = cfg[sample].Branches[branchName].isAlso[0]

            partsInBranches += [partName]

        #print("partsInBranches = ", partsInBranches)

################################################################################
## Parses the configuration dictionaries and configure the tuples             ##
################################################################################
        tuple = DecayTreeTuple(sample + "Tuple")
        tuple.Inputs = [filterSequence.outputLocation()]
        tuple.Decay = cfg[sample].Decay
        tuple.ToolList = ["TupleToolANNPID"]
        if mdstInput:
            tuple.RootInTES = "/Event/Turbo"

        if "e" in partsInBranches:
            ttBrem = tuple.addTupleTool("TupleToolBremInfo")
            ttBrem.Particle = ["pi+", "p", "K+", "mu+", "e+"]
            ttBrem.Verbose = True
            ttBrem.RootInTES = ""  #### !!!!

        ttPPD = tuple.addTupleTool("TupleToolProtoPData")
        ttPPD.DataList = [
            "VeloCharge", "CaloEoverP", "CaloEcalChi2", "CaloPrsE",
            "CaloHcalE", "EcalPIDe", "PrsPIDe", "HcalPIDe", "CaloEcalE"
        ]

        if writeMuonPIDPlus and ("mu" in partsInBranches):
            muidPlus = tuple.addTupleTool("TupleToolMuonPidPlus")
            muidPlus.MuonIDPlusToolName = "MuonIDPlusTool"
            muidPlus.OutputLevel = 5
            muidPlus.RootInTES = ""  ####  !!!!!
            muidPlus.addTool(MuonIDPlusTool)
            muidPlus.MuonIDPlusTool.OutputLevel = 5
            muidPlus.MuonIDPlusTool.RootInTES = ""  ####  !!!!!
            muidPlus.MuonIDPlusTool.ReleaseObjectOwnership = False
            muidPlus.MuonIDPlusTool.MatchToolName = "MuonChi2MatchTool"
            muidPlus.Verbose = True

        eventTool = tuple.addTupleTool("LoKi::Hybrid::EvtTupleTool/LoKiEvent")
        if 'VOID' in eventVariables.keys():
            eventTool.VOID_Variables = eventVariables['VOID']

        if not mdstInput:
            if 'ODIN' in eventVariables.keys():
                eventTool.ODIN_Variables = eventVariables['ODIN']

        if 'HLT' in eventVariables.keys():
            eventTool.HLT_Variables = eventVariables['HLT']

        if 'L0DU' in eventVariables.keys():
            eventTool.L0DU_Variables = eventVariables['L0DU']

        eventTool.Preambulo = [
            "from LoKiTracks.decorators import *",
            "from LoKiCore.functions import *"
        ]
        tuple.addTool(eventTool)

        if mdstInput:
            matchingLocation = {
                "mu+": "/Event/PIDCALIB/Phys/Match" + sample + "/Particles",
                "pi+": "/Event/PIDCALIB/Phys/Match" + sample + "/Particles",
                "K+": "/Event/PIDCALIB/Phys/Match" + sample + "/Particles",
                "p+": "/Event/PIDCALIB/Phys/Match" + sample + "/Particles",
                "e+": "/Event/PIDCALIB/Phys/Match" + sample + "/Particles",
            }
        else:
            if cfg[sample].Downstream:
                matchingLocation = {
                    "mu+": "Phys/StdLooseDownMuons/Particles",
                    "pi+": "Phys/StdNoPIDsDownPions/Particles",
                    "K+": "Phys/StdNoPIDsDownKaons/Particles",
                    "p+": "Phys/StdNoPIDsDownProtons/Particles",
                    "e+": "Phys/StdNoPIDsDownElectrons/Particles",
                }
            else:
                matchingLocation = {
                    "mu+": "Phys/StdAllNoPIDsMuons/Particles",
                    "pi+": "Phys/StdAllNoPIDsPions/Particles",
                    "K+": "Phys/StdAllNoPIDsKaons/Particles",
                    "p+": "Phys/StdAllNoPIDsProtons/Particles",
                    "e+": "Phys/StdAllNoPIDsElectrons/Particles",
                }

        tupleSequences += [tuple]

        for branchName in cfg[sample].Branches:

            partName = branchName
            if len(cfg[sample].Branches[branchName].isAlso) > 0:
                partName = cfg[sample].Branches[branchName].isAlso[0]

            #print ("PartName = ", partName)

            b = tuple.addBranches(
                {branchName: cfg[sample].Branches[branchName].Particle})
            b = b[branchName]
            matcher = b.addTupleTool("TupleToolTwoParticleMatching/Matcher_" +
                                     branchName)
            matcher.ToolList = []
            matcher.Prefix = ""
            matcher.Suffix = "_Brunel"
            matcher.MatchLocations = matchingLocation

            lokitool = b.addTupleTool("LoKi::Hybrid::TupleTool/LoKi_" +
                                      branchName)
            vardict = copy(varsByType[cfg[sample].Branches[branchName].Type])
            pidcalibtool = b.addTupleTool("TupleToolPIDCalib/PIDCalibTool_" +
                                          branchName)
            pidcalibtool_matched = TTpid("PIDCalibTool_match_" + branchName)
            for partName in [branchName
                             ] + cfg[sample].Branches[branchName].isAlso:
                if partName in varsByName:
                    vardict.update(varsByName[partName])


#        if partName == 'e':
#          pidcalibtool.FillBremInfo = True
#          pidcalibtool_matched.FillBremInfo = True

            lokimatchedtool = LokiTool("LoKi_match_" + branchName)

            matcher.addTool(pidcalibtool_matched)
            matcher.ToolList += [
                "LoKi::Hybrid::TupleTool/LoKi_match_" + branchName,
                "TupleToolPIDCalib/PIDCalibTool_match_" + branchName
            ]

            from Configurables import TupleToolTISTOS
            tistostool = TupleToolTISTOS("TISTOSForTheOffline" + branchName)
            tistostool.FillL0 = True
            tistostool.FillHlt1 = True
            tistostool.FillHlt2 = False
            tistostool.Verbose = True  # 16/01/2020 for L0Calo
            tistostool.VerboseL0 = True
            tistostool.VerboseHlt1 = True
            tistostool.VerboseHlt2 = False
            tistostool.TriggerList = triggerList
            matcher.addTool(tistostool)
            matcher.ToolList += [
                "TupleToolTISTOS/TISTOSForTheOffline" + branchName
            ]

            # 16/01/2020 for L0Calo variables
            from Configurables import TupleToolL0Calo
            l0calotool = TupleToolL0Calo("L0CaloForTheOffline" + branchName)
            l0calotool.WhichCalo = "HCAL"
            l0calotool.TriggerClusterLocation = "Trig/L0/FullCalo"  # Added 29/01/2020 for "trigger" variables
            matcher.addTool(l0calotool)
            matcher.ToolList += [
                "TupleToolL0Calo/L0CaloForTheOffline" + branchName
            ]

            from Configurables import TupleToolBremInfo, TupleToolProtoPData, TupleToolANNPID, TupleToolMuonPidPlus

            if partName == "e":
                ttbi = TupleToolBremInfo("BremInfoForTheOffline" + branchName)
                ttbi.Particle = ["pi+", "p", "K+", "mu+", "e+"]
                ttbi.RootInTES = ""
                matcher.addTool(ttbi)
                matcher.ToolList += [
                    "TupleToolBremInfo/BremInfoForTheOffline" + branchName
                ]

            ttppd = TupleToolProtoPData("ProtoPDataForTheOffline" + branchName)
            ttppd.DataList = [
                "VeloCharge", "CaloEoverP", "CaloEcalChi2", "CaloPrsE",
                "CaloHcalE", "EcalPIDe", "PrsPIDe", "HcalPIDe", "CaloEcalE"
            ]
            matcher.addTool(ttppd)
            matcher.ToolList += [
                "TupleToolProtoPData/ProtoPDataForTheOffline" + branchName
            ]

            ttann = TupleToolANNPID("ANNPIDForTheOffline" + branchName)
            ttann.PIDTypes = [
                "Electron", "Muon", "Pion", "Kaon", "Proton", "Ghost",
                "Deuteron"
            ]
            #      ttann.PIDTypes = [ "Electron","Muon","Pion","Kaon","Proton","Ghost" ]
            ttann.ANNPIDTunes = [
                "MC12TuneV2", "MC12TuneV3", "MC12TuneV4", "MC15TuneV1",
                "MC15TuneDNNV1", "MC15TuneCatBoostV1", "MC15TuneFLAT4dV1"
            ]
            matcher.addTool(ttann)
            matcher.ToolList += [
                "TupleToolANNPID/ANNPIDForTheOffline" + branchName
            ]

            if writeMuonPIDPlus and partName == "mu":
                ttmuidPlus = TupleToolMuonPidPlus(
                    "TupleToolMuonPidPlusForTheOffline" + branchName)
                ttmuidPlus.MuonIDPlusToolName = "MuonIDPlusTool"
                ttmuidPlus.OutputLevel = 5
                ttmuidPlus.RootInTES = ""  ####  !!!!!
                ttmuidPlus.addTool(MuonIDPlusTool)
                ttmuidPlus.MuonIDPlusTool.OutputLevel = 5
                ttmuidPlus.MuonIDPlusTool.RootInTES = ""  ####  !!!!!
                ttmuidPlus.MuonIDPlusTool.ReleaseObjectOwnership = False
                ttmuidPlus.MuonIDPlusTool.MatchToolName = "MuonChi2MatchTool"
                ttmuidPlus.Verbose = True
                matcher.addTool(ttmuidPlus)
                matcher.ToolList += [
                    "TupleToolMuonPidPlus/TupleToolMuonPidPlusForTheOffline" +
                    branchName
                ]

            vardict.update(cfg[sample].Branches[branchName].LokiVariables)
            lokimatchedtool.Variables = vardict
            lokitool.Variables = vardict

            matcher.addTool(lokimatchedtool)

            # Additional variables for Greg/Phoebe's uBDT
            from Configurables import TupleToolANNPIDTrainingLight
            if hasattr(tuple, 'probe'):
                tuple.probe.addTool(TupleToolANNPIDTrainingLight,
                                    name='TupleToolANNPIDTrainingLight')
                tuple.probe.ToolList += [
                    'TupleToolANNPIDTrainingLight/TupleToolANNPIDTrainingLight'
                ]

    print "Input TES: "
    print "\n".join([f.outputLocation() for f in filterSequences])
    if mdstOutputFile:
        dstSequences += configureMicroDSTwriter(
            mdstOutputFile, mdstOutputPrefix, filterSequences + matchSequences)

    if mdstInput:
        return (reviveSequences + swSequences + filterSequences +
                matchSequences + tupleSequences)
    else:
        if tupleOutput:
            return (reviveSequences + swSequences + filterSequences +
                    matchSequences + dstSequences + tupleSequences)
        else:
            return (reviveSequences + filterSequences + matchSequences +
                    dstSequences)
Example #21
0
"Hlt2DiProton","Hlt2DiProtonTF","Hlt2DiProtonLowMult","Hlt2DiProtonLowMultTF","Hlt2CharmSemilepD02HMuNu_D02KMuNuWS","Hlt2CharmSemilepD02HMuNu_D02PiMuNuWS","Hlt2CharmSemilepD02HMuNu_D02KMuNu","Hlt2CharmSemilepD02HMuNu_D02PiMuNu","Hlt2TFBc2JpsiMuX","Hlt2TFBc2JpsiMuXSignal","Hlt2DisplVerticesLowMassSingle","Hlt2DisplVerticesHighMassSingle","Hlt2DisplVerticesDouble","Hlt2DisplVerticesSinglePostScaled","Hlt2DisplVerticesHighFDSingle","Hlt2DisplVerticesSingleDown","Hlt2CharmSemilepD2HMuMu","Hlt2CharmSemilepD2HMuMuWideMass","Hlt2B2HHPi0_Merged","Hlt2CharmHadD2HHH","Hlt2CharmHadD2HHHWideMass","Hlt2DiMuon","Hlt2DiMuonLowMass",
"Hlt2DiMuonJPsi","Hlt2DiMuonJPsiHighPT","Hlt2DiMuonPsi2S","Hlt2DiMuonB","Hlt2DiMuonZ","Hlt2DiMuonDY1","Hlt2DiMuonDY2","Hlt2DiMuonDY3","Hlt2DiMuonDY4","Hlt2DiMuonDetached","Hlt2DiMuonDetachedHeavy","Hlt2DiMuonDetachedJPsi","Hlt2DiMuonNoPV","Hlt2TriMuonDetached","Hlt2TriMuonTau","Hlt2CharmSemilepD02HHMuMu","Hlt2CharmSemilepD02HHMuMuWideMass","Hlt2CharmHadD02HHHH","Hlt2CharmHadD02HHHHWideMass","Hlt2ErrorEvent","Hlt2Global","Hlt2diPhotonDiMuon","Hlt2LowMultMuon","Hlt2LowMultHadron","Hlt2LowMultPhoton","Hlt2LowMultElectron","Hlt2SingleTFElectron","Hlt2SingleTFVHighPtElectron","Hlt2B2HHLTUnbiasedDetached","Hlt2CharmHadLambdaC2KPPi",
"Hlt2SingleMuonVHighPT","Hlt2CharmSemilepD02HMuNu_D02KMuNuTight","Hlt2CharmHadMinBiasLambdaC2KPPi","Hlt2CharmHadMinBiasD02KPi","Hlt2CharmHadMinBiasD02KK","Hlt2CharmHadMinBiasDplus2hhh","Hlt2CharmHadMinBiasLambdaC2LambdaPi","Hlt2DisplVerticesSingle","Hlt2DisplVerticesDoublePostScaled","Hlt2DisplVerticesSingleHighMassPostScaled","Hlt2DisplVerticesSingleHighFDPostScaled","Hlt2DisplVerticesSingleMVPostScaled","Hlt2RadiativeTopoTrackTOS","Hlt2RadiativeTopoPhotonL0","Hlt2DiMuonPsi2SHighPT","Hlt2DoubleDiMuon","Hlt2DiMuonAndMuon","Hlt2DiMuonAndGamma","Hlt2DiMuonAndD0","Hlt2DiMuonAndDp","Hlt2DiMuonAndDs","Hlt2DiMuonAndLc",
"Hlt2CharmSemilepD02HHMuMuHardHadronsSoftMuons","Hlt2CharmSemilepD02HHMuMuHardHadronsSoftMuonsWideMass","Hlt2CharmSemilepD02HHMuMuHardHadronsAndMuons","Hlt2CharmSemilepD02HHMuMuHardHadronsAndMuonsWideMass","Hlt2TopoRad2BodyBBDT","Hlt2TopoRad2plus1BodyBBDT","Hlt2Lumi","Hlt2LowMultHadron_nofilter","Hlt2LowMultElectron_nofilter","Hlt2CharmHadD02HHKsDD","Hlt2CharmHadD2KS0KS0","Hlt2CharmHadD2KS0KS0WideMass","Hlt2ExpressD02KPi","Hlt2CharmHadLambdaC2KPPiWideMass","Hlt2CharmHadLambdaC2KPK","Hlt2CharmHadLambdaC2KPKWideMass","Hlt2CharmHadLambdaC2PiPPi","Hlt2CharmHadLambdaC2PiPPiWideMass","Hlt2CharmHadLambdaC2PiPK",
"Hlt2CharmHadLambdaC2PiPKWideMass","Hlt2CharmHadD2KS0H_D2KS0DDPi","Hlt2CharmHadD2KS0H_D2KS0DDK","Hlt2DiPhi","Hlt2CharmHadD02HHHHDstNoHltOne_4pi","Hlt2CharmHadD02HHHHDstNoHltOne_4piWideMass","Hlt2CharmHadD02HHHHDstNoHltOne_K3pi","Hlt2CharmHadD02HHHHDstNoHltOne_K3piWideMass","Hlt2CharmHadD02HHHHDstNoHltOne_KKpipi","Hlt2CharmHadD02HHHHDstNoHltOne_KKpipiWideMass","Hlt2CharmHadD02HHHHDstNoHltOne_2K2pi","Hlt2CharmHadD02HHHHDstNoHltOne_2K2piWideMass","Hlt2CharmHadD02HHHHDstNoHltOne_3Kpi","Hlt2CharmHadD02HHHHDstNoHltOne_3KpiWideMass","Hlt2CharmHadD02HHHHDstNoHltOne_Ch2","Hlt2CharmHadD02HHHHDstNoHltOne_Ch2WideMass",
"Hlt2CharmSemilep3bodyD2PiMuMu","Hlt2CharmSemilep3bodyD2PiMuMuSS","Hlt2CharmSemilep3bodyD2KMuMu","Hlt2CharmSemilep3bodyD2KMuMuSS","Hlt2CharmSemilep3bodyLambdac2PMuMu","Hlt2CharmSemilep3bodyLambdac2PMuMuSS","Hlt2LambdaC_LambdaC2Lambda0LLPi","Hlt2LambdaC_LambdaC2Lambda0LLK","Hlt2LambdaC_LambdaC2Lambda0DDPi","Hlt2LambdaC_LambdaC2Lambda0DDK","Hlt2RadiativeTopoTrack","Hlt2RadiativeTopoPhoton","Hlt2CharmHadD02HHHHDst_4pi","Hlt2CharmHadD02HHHHDst_4piWideMass","Hlt2CharmHadD02HHHHDst_K3pi","Hlt2CharmHadD02HHHHDst_K3piWideMass","Hlt2CharmHadD02HHHHDst_KKpipi","Hlt2CharmHadD02HHHHDst_KKpipiWideMass","Hlt2CharmHadD02HHHHDst_2K2pi",
"Hlt2CharmHadD02HHHHDst_2K2piWideMass","Hlt2CharmHadD02HHHHDst_3Kpi","Hlt2CharmHadD02HHHHDst_3KpiWideMass","Hlt2CharmHadD02HHHHDst_Ch2","Hlt2CharmHadD02HHHHDst_Ch2WideMass","Hlt2CharmSemilepD02PiPiMuMu","Hlt2CharmSemilepD02KKMuMu","Hlt2CharmSemilepD02KPiMuMu","Hlt2CharmHadD02HHHH_4pi","Hlt2CharmHadD02HHHH_4piWideMass","Hlt2CharmHadD02HHHH_K3pi","Hlt2CharmHadD02HHHH_K3piWideMass","Hlt2CharmHadD02HHHH_KKpipi","Hlt2CharmHadD02HHHH_KKpipiWideMass","Hlt2CharmHadD02HHHH_2K2pi","Hlt2CharmHadD02HHHH_2K2piWideMass","Hlt2CharmHadD02HHHH_3Kpi","Hlt2CharmHadD02HHHH_3KpiWideMass","Hlt2CharmHadD02HHHH_Ch2","Hlt2CharmHadD02HHHH_Ch2WideMass",
"Hlt2DiMuonDetachedPsi2S","Hlt2CharmHadD02HHXDst_hhX","Hlt2CharmHadD02HHXDst_hhXWideMass","Hlt2LowMultD2KPi","Hlt2LowMultD2KPiPi","Hlt2LowMultD2K3Pi","Hlt2LowMultChiC2HH","Hlt2LowMultChiC2HHHH","Hlt2LowMultD2KPiWS","Hlt2LowMultD2KPiPiWS","Hlt2LowMultD2K3PiWS","Hlt2LowMultChiC2HHWS","Hlt2LowMultChiC2HHHHWS","Hlt2LowMultDDInc","Hlt2DisplVerticesSingleLoosePS","Hlt2DisplVerticesSingleHighFD","Hlt2DisplVerticesSingleVeryHighFD","Hlt2DisplVerticesSingleHighMass","Hlt2DisplVerticesSinglePS","Hlt2DisplVerticesDoublePS","Hlt2CharmHadD2HHHKsLL","Hlt2CharmHadD2HHHKsDD","Hlt2KshortToMuMuPiPi","Hlt2LowMultChiC2PP","Hlt2LowMultDDIncCP",
"Hlt2LowMultDDIncVF","Hlt2LowMultLMR2HH","Hlt2HighPtJets","Hlt2ChargedHyperon_Xi2Lambda0LLPi","Hlt2ChargedHyperon_Xi2Lambda0LLMu","Hlt2ChargedHyperon_Omega2Lambda0LLK","Hlt2ChargedHyperon_Xi2Lambda0DDPi","Hlt2ChargedHyperon_Xi2Lambda0DDMu","Hlt2ChargedHyperon_Omega2Lambda0DDK","Hlt2CharmHadD02HHXDst_BaryonhhX","Hlt2CharmHadD02HHXDst_BaryonhhXWideMass","Hlt2CharmHadD02HHXDst_BaryonhhXWithKSLL","Hlt2CharmHadD02HHXDst_BaryonhhXWithKSLLWideMass","Hlt2CharmHadD02HHXDst_BaryonhhXWithLambda0LL","Hlt2CharmHadD02HHXDst_BaryonhhXWithLambda0LLWideMass","Hlt2CharmHadD02HHXDst_BaryonhhXWithKSDD",
"Hlt2CharmHadD02HHXDst_BaryonhhXWithKSDDWideMass","Hlt2CharmHadD02HHXDst_BaryonhhXWithLambda0DD","Hlt2CharmHadD02HHXDst_BaryonhhXWithLambda0DDWideMass","Hlt2CharmHadD02HHXDst_LeptonhhX","Hlt2CharmHadD02HHXDst_LeptonhhXWideMass","Hlt2CharmHadD02HHXDst_LeptonhhXWithKSLL","Hlt2CharmHadD02HHXDst_LeptonhhXWithKSLLWideMass","Hlt2CharmHadD02HHXDst_LeptonhhXWithLambda0LL","Hlt2CharmHadD02HHXDst_LeptonhhXWithLambda0LLWideMass","Hlt2CharmHadD02HHXDst_LeptonhhXWithKSDD","Hlt2CharmHadD02HHXDst_LeptonhhXWithKSDDWideMass","Hlt2CharmHadD02HHXDst_LeptonhhXWithLambda0DD","Hlt2CharmHadD02HHXDst_LeptonhhXWithLambda0DDWideMass"]]

LoKi_DTFMASS_Phi_noPV = LoKi__Hybrid__TupleTool("LoKi_DTFMASS_Phi_noPV")
LoKi_DTFMASS_Phi_noPV.Variables = {
        "DTF_CHI2_noPV"   : "DTF_CHI2( False, 'phi(1020)' )",
        "DTF_NDOF_noPV"   : "DTF_NDOF( False, 'phi(1020)' )",
        "DTF_M_noPV"      : "DTF_FUN ( M, False, 'phi(1020)' )",
        "DTF_M_Ks1_noPV"    : "DTF_FUN ( CHILD(M,1), False, 'phi(1020)' )",
        "DTF_M_Ks2_noPV"    : "DTF_FUN ( CHILD(M,2), False, 'phi(1020)' )",
        }
tuple.Phi.ToolList+=["LoKi::Hybrid::TupleTool/LoKi_DTFMASS_Phi_noPV"]
tuple.Phi.addTool(LoKi_DTFMASS_Phi_noPV)

LoKi_DTFMASS_Phi_PV = LoKi__Hybrid__TupleTool("LoKi_DTFMASS_Phi_PV")
LoKi_DTFMASS_Phi_PV.Variables = {
        "DTF_CHI2_PV"   : "DTF_CHI2( True, 'phi(1020)' )",
        "DTF_NDOF_PV"   : "DTF_NDOF( True, 'phi(1020)' )",
        "DTF_M_PV"      : "DTF_FUN ( M, True, 'phi(1020)' )",
        "DTF_M_Ks1_PV"    : "DTF_FUN ( CHILD(M,1), True, 'phi(1020)' )",
        "DTF_M_Ks2_PV"    : "DTF_FUN ( CHILD(M,2), True, 'phi(1020)' )",
        }
tuple.Phi.ToolList+=["LoKi::Hybrid::TupleTool/LoKi_DTFMASS_Phi_PV"]
Example #22
0
TISTOSTool = TupleToolTISTOS('TISTOSTool')
TISTOSTool.VerboseL0   = True
TISTOSTool.VerboseHlt1 = True
TISTOSTool.VerboseHlt2 = True
TISTOSTool.TriggerList = triglist[:]
TISTOSTool.addTool( TriggerTisTos, name="TriggerTisTos")

LoKi_B = LoKi__Hybrid__TupleTool("LoKi_B")
LoKi_B.Variables =  {
        "Best_PV_CORRM" : "BPVCORRM",
        "Best_PV_Eta"   : "BPVETA",
        "ETA" : "ETA",
        "PHI" : "PHI",
    "LOKI_FDCHI2"          : "BPVVDCHI2",
    "LOKI_FDS"             : "BPVDLS",
    "LOKI_DIRA"            : "BPVDIRA",
    "LOKI_DTF_CTAU"        : "DTF_CTAU( 0, True )",
    "LOKI_DTF_CTAUS"       : "DTF_CTAUSIGNIFICANCE( 0, True )",
    "LOKI_DTF_CHI2NDOF"    : "DTF_CHI2NDOF( True )",
    "LOKI_DTF_CTAUERR"     : "DTF_CTAUERR( 0, True )",
    "LOKI_MASS_JpsiConstr" : "DTF_FUN ( M , False , 'J/psi(1S)' )" ,
    "LOKI_DTF_VCHI2NDOF"   : "DTF_FUN ( VFASPF(VCHI2/VDOF) , True )",
        }

LoKi_psi = LoKi__Hybrid__TupleTool("LoKi_psi")
LoKi_psi.Variables = {
    "q_PV_constr_B_constr" : "DTF_FUN ( M , True , 'B+' )" ,
    "q_PV_constr" : "DTF_FUN ( M , True )" ,
    "q_B_constr"  : "DTF_FUN ( M , False , 'B+' )" ,
    "q_no_constr" : "DTF_FUN ( M , False )" ,
    }
Example #23
0
LoKi_B.Variables = {
    "ETA":
    "ETA",
    "PHI":
    "PHI",
    "FDCHI2":
    "BPVVDCHI2",
    "FDS":
    "BPVDLS",
    "DIRA":
    "BPVDIRA",
    "pi0veto":
    "CHILDFUN ( PINFO( 25030 , -1 ) , 'gamma' == ABSID ) ",
    "DTF_CTAU":
    "DTF_CTAU( 0, True )",
    "DTF_CTAUS":
    "DTF_CTAUSIGNIFICANCE( 0, True )",
    "DTF_CHI2NDOF":
    "DTF_CHI2NDOF( True )",
    "DTF_CTAUERR":
    "DTF_CTAUERR( 0, True )",
    "DTF_MASS_constr1":
    "DTF_FUN ( M , True , strings(['chi_c1(1P)', 'J/psi(1S)']) )",
    "DTF_MASS_constr2":
    "DTF_FUN ( M , True , strings(['chi_c2(1P)', 'J/psi(1S)']) )",
    "DTF_VCHI2NDOF":
    "DTF_FUN ( VFASPF(VCHI2/VDOF) , True )",
    "PX_chic1P_constr1":
    "DTF_FUN ( CHILD(PX, 1) , True  , strings(['J/psi(1S)', 'chi_c1(1P)']) )",
    "PY_chic1P_constr1":
    "DTF_FUN ( CHILD(PY, 1) , True  , strings(['J/psi(1S)', 'chi_c1(1P)']) )",
    "PZ_chic1P_constr1":
    "DTF_FUN ( CHILD(PZ, 1) , True  , strings(['J/psi(1S)', 'chi_c1(1P)']) )",
    "PE_chic1P_constr1":
    "DTF_FUN ( CHILD( E, 1) , True  , strings(['J/psi(1S)', 'chi_c1(1P)']) )",
    "PX_proton_constr1":
    "DTF_FUN ( CHILD(PX, 2) , True  , strings(['J/psi(1S)', 'chi_c1(1P)']) )",
    "PY_proton_constr1":
    "DTF_FUN ( CHILD(PY, 2) , True  , strings(['J/psi(1S)', 'chi_c1(1P)']) )",
    "PZ_proton_constr1":
    "DTF_FUN ( CHILD(PZ, 2) , True  , strings(['J/psi(1S)', 'chi_c1(1P)']) )",
    "PE_proton_constr1":
    "DTF_FUN ( CHILD( E, 2) , True  , strings(['J/psi(1S)', 'chi_c1(1P)']) )",
    "PX_kaon_constr1":
    "DTF_FUN ( CHILD(PX, 3) , True  , strings(['J/psi(1S)', 'chi_c1(1P)']) )",
    "PY_kaon_constr1":
    "DTF_FUN ( CHILD(PY, 3) , True  , strings(['J/psi(1S)', 'chi_c1(1P)']) )",
    "PZ_kaon_constr1":
    "DTF_FUN ( CHILD(PZ, 3) , True  , strings(['J/psi(1S)', 'chi_c1(1P)']) )",
    "PE_kaon_constr1":
    "DTF_FUN ( CHILD( E, 3) , True  , strings(['J/psi(1S)', 'chi_c1(1P)']) )",
    "PX_chic1P_constr2":
    "DTF_FUN ( CHILD(PX, 1) , True  , strings(['J/psi(1S)', 'chi_c2(1P)']) )",
    "PY_chic1P_constr2":
    "DTF_FUN ( CHILD(PY, 1) , True  , strings(['J/psi(1S)', 'chi_c2(1P)']) )",
    "PZ_chic1P_constr2":
    "DTF_FUN ( CHILD(PZ, 1) , True  , strings(['J/psi(1S)', 'chi_c2(1P)']) )",
    "PE_chic1P_constr2":
    "DTF_FUN ( CHILD( E, 1) , True  , strings(['J/psi(1S)', 'chi_c2(1P)']) )",
    "PX_proton_constr2":
    "DTF_FUN ( CHILD(PX, 2) , True  , strings(['J/psi(1S)', 'chi_c2(1P)']) )",
    "PY_proton_constr2":
    "DTF_FUN ( CHILD(PY, 2) , True  , strings(['J/psi(1S)', 'chi_c2(1P)']) )",
    "PZ_proton_constr2":
    "DTF_FUN ( CHILD(PZ, 2) , True  , strings(['J/psi(1S)', 'chi_c2(1P)']) )",
    "PE_proton_constr2":
    "DTF_FUN ( CHILD( E, 2) , True  , strings(['J/psi(1S)', 'chi_c2(1P)']) )",
    "PX_kaon_constr2":
    "DTF_FUN ( CHILD(PX, 3) , True  , strings(['J/psi(1S)', 'chi_c2(1P)']) )",
    "PY_kaon_constr2":
    "DTF_FUN ( CHILD(PY, 3) , True  , strings(['J/psi(1S)', 'chi_c2(1P)']) )",
    "PZ_kaon_constr2":
    "DTF_FUN ( CHILD(PZ, 3) , True  , strings(['J/psi(1S)', 'chi_c2(1P)']) )",
    "PE_kaon_constr2":
    "DTF_FUN ( CHILD( E, 3) , True  , strings(['J/psi(1S)', 'chi_c2(1P)']) )",
}
Example #24
0
LoKiVariables2.Variables = {
    "LOKI_Mass" : "DTF_FUN(M, True)",
    "LOKI_Chi2" : "DTF_CHI2(True)",
    "LOKI_ndof" : "DTF_NDOF(True)",
    "LOKI_MassError2" : "DTF_FUN(M2ERR2, True)",
    "LOKI_DTF_CTAU"        : "DTF_CTAU( 0, True )",
    "LOKI_DTF_CTAUS"       : "DTF_CTAUSIGNIFICANCE( 0, True )",
    "LOKI_DTF_CTAUERR"     : "DTF_CTAUERR( 0, True )",

    "PX_kaon1": "DTF_FUN(CHILD(PX, 1,1), True)",
    "PY_kaon1": "DTF_FUN(CHILD(PY, 1,1), True)",
    "PZ_kaon1": "DTF_FUN(CHILD(PZ, 1,1), True)",

    "PX_kaon2": "DTF_FUN(CHILD(PX, 1,2), True)",
    "PY_kaon2": "DTF_FUN(CHILD(PY, 1,2), True)",
    "PZ_kaon2": "DTF_FUN(CHILD(PZ, 1,2), True)",

    "PX_pion1": "DTF_FUN(CHILD(PX, 2,1), True)",
    "PY_pion1": "DTF_FUN(CHILD(PY, 2,1), True)",
    "PZ_pion1": "DTF_FUN(CHILD(PZ, 2,1), True)",

    "PX_pion2": "DTF_FUN(CHILD(PX, 2,2), True)",
    "PY_pion2": "DTF_FUN(CHILD(PY, 2,2), True)",
    "PZ_pion2": "DTF_FUN(CHILD(PZ, 2,2), True)",

    "BCON_LOKI_Mass" : "DTF_FUN(M, True, strings(['B_s0']))",
    "BCON_LOKI_Chi2" : "DTF_CHI2(True, strings(['B_s0']))",
    "BCON_LOKI_ndof" : "DTF_NDOF(True, strings(['B_s0']))",
    "BCON_PX_kaon1": "DTF_FUN(CHILD(PX, 1,1), True, strings(['B_s0']))",
    "BCON_PY_kaon1": "DTF_FUN(CHILD(PY, 1,1), True, strings(['B_s0']))",
    "BCON_PZ_kaon1": "DTF_FUN(CHILD(PZ, 1,1), True, strings(['B_s0']))",

    "BCON_PX_kaon2": "DTF_FUN(CHILD(PX, 1,2), True, strings(['B_s0']))",
    "BCON_PY_kaon2": "DTF_FUN(CHILD(PY, 1,2), True, strings(['B_s0']))",
    "BCON_PZ_kaon2": "DTF_FUN(CHILD(PZ, 1,2), True, strings(['B_s0']))",

    "BCON_PX_pion1": "DTF_FUN(CHILD(PX, 2,1), True, strings(['B_s0']))",
    "BCON_PY_pion1": "DTF_FUN(CHILD(PY, 2,1), True, strings(['B_s0']))",
    "BCON_PZ_pion1": "DTF_FUN(CHILD(PZ, 2,1), True, strings(['B_s0']))",

    "BCON_PX_pion2": "DTF_FUN(CHILD(PX, 2,2), True, strings(['B_s0']))",
    "BCON_PY_pion2": "DTF_FUN(CHILD(PY, 2,2), True, strings(['B_s0']))",
    "BCON_PZ_pion2": "DTF_FUN(CHILD(PZ, 2,2), True, strings(['B_s0']))"
    }
Example #25
0
    def __apply_configuration__(self):

        from Configurables import (GaudiSequencer, CombineParticles,
                                   OfflineVertexFitter)
        from PhysSelPython.Wrappers import Selection, SelectionSequence, DataOnDemand

        seq = self.getProp("Sequencer")
        if seq == None: raise RuntimeError("ERROR : Sequence not set")

        if self.getProp("RunSelection"):

            # STD particles
            from StandardParticles import StdNoPIDsPions, StdNoPIDsKaons

            # phi -> K+ K-
            Phi2KKName = self.__sel_name__ + "_Phi2KK"
            Phi2KK = CombineParticles(Phi2KKName)
            Phi2KK.DecayDescriptor = "phi(1020) -> K+ K-"
            Phi2KK.CombinationCut = "(ADAMASS('phi(1020)')<75*MeV)"
            Phi2KK.MotherCut = "(ADMASS('phi(1020)')<50*MeV) & (BPVVDCHI2>60) & (MIPDV(PRIMARY)<0.5) & (VFASPF(VCHI2) < 20)"
            Phi2KK.DaughtersCuts = {
                "K+":
                "(PT>300*MeV) & (P>2*GeV) & (MIPDV(PRIMARY) < 0.5) &  (BPVIPCHI2() > 20)",
                "K-":
                "(PT>300*MeV) & (P>2*GeV) & (MIPDV(PRIMARY) < 0.5) &  (BPVIPCHI2() > 20)"
            }
            self.setOptions(Phi2KK)
            Phi2KKSel = Selection(Phi2KKName + 'Sel',
                                  Algorithm=Phi2KK,
                                  RequiredSelections=[StdNoPIDsKaons])

            # Bs -> J/psi phi
            Ds2piPhiName = self.__sel_name__
            Ds2piPhi = CombineParticles(Ds2piPhiName)
            Ds2piPhi.DecayDescriptor = "[D_s+ -> pi+ phi(1020)]cc"
            Ds2piPhi.addTool(OfflineVertexFitter)
            Ds2piPhi.ParticleCombiners.update({"": "OfflineVertexFitter"})
            Ds2piPhi.OfflineVertexFitter.useResonanceVertex = True
            Ds2piPhi.CombinationCut = "(ADAMASS('D_s+')<75*MeV)"
            Ds2piPhi.MotherCut = "(ADMASS('D_s+')<50*MeV) & (BPVDIRA>0.9999) & (BPVVDCHI2>85) & (MIPDV(PRIMARY)<0.1) &  (VFASPF(VCHI2) < 10)"
            Ds2piPhi.DaughtersCuts = {
                "pi+":
                "(PT>300*MeV) & (P>2*GeV) & (MIPDV(PRIMARY) >0.1) & (BPVIPCHI2() > 20)"
            }
            self.setOptions(Ds2piPhi)
            Ds2piPhiSel = Selection(
                Ds2piPhiName + 'Sel',
                Algorithm=Ds2piPhi,
                RequiredSelections=[Phi2KKSel, StdNoPIDsPions])

            # Selection Sequence
            selSeq = SelectionSequence(self.__sel_name__ + 'Seq',
                                       TopSelection=Ds2piPhiSel)

            # Run the selection sequence.
            seq.Members += [selSeq.sequence()]

        # Particle Monitoring plots
        if self.getProp("RunMonitors"):

            from Configurables import ParticleMonitor
            plotter = ParticleMonitor(self.__sel_name__ + "Plots")
            if self.getProp("RunSelection"):
                plotter.Inputs = ['Phys/' + self.__sel_name__ + 'Sel']
            else:
                plotter.Inputs = self.getProp("Candidates")
            plotter.PeakCut = "(ADMASS('D_s+')<100*MeV)"
            plotter.SideBandCut = "(ADMASS('D_s+')>100*MeV)"
            plotter.PlotTools = self.getProp("PlotTools")
            self.setOptions(plotter)
            seq.Members += [plotter]

        # Make a DST ?
        if self.getProp("MakeSelDST"):

            # Prescale
            from Configurables import DeterministicPrescaler
            scaler = DeterministicPrescaler(
                self.__sel_name__ + 'PreScale',
                AcceptFraction=self.getProp("DSTPreScaleFraction"))
            seq.Members += [scaler]
            # Write the DST
            MyDSTWriter = SelDSTWriter(self.__sel_name__ + "DST",
                                       SelectionSequences=[selSeq],
                                       OutputPrefix=self.__sel_name__)
            seq.Members += [MyDSTWriter.sequence()]

        # MC Performance checking ?
        if self.getProp("MCChecks"):

            from Configurables import ParticleEffPurMoni
            mcPerf = ParticleEffPurMoni(Ds2piPhiName + "MCPerf")
            mcPerf.Inputs = ['Phys/' + self.__sel_name__ + 'Sel']
            self.setOptions(mcPerf)
            seq.Members += [mcPerf]

        # Ntuple ?
        if self.getProp("MakeNTuple"):

            outputLevel = INFO

            from Configurables import (
                DecayTreeTuple, TupleToolDecay, TupleToolMCTruth,
                TupleToolMCBackgroundInfo, TupleToolGeometry,
                TupleToolKinematic, TupleToolPrimaries, TupleToolEventInfo,
                MCTupleToolHierarchy, MCTupleToolKinematic, TupleToolPid,
                TupleToolTrackInfo, TupleToolVtxIsoln, LoKi__Hybrid__TupleTool)

            Tuple = DecayTreeTuple(Ds2piPhiName + "Tuple")
            Tuple.Inputs = ["Phys/" + Ds2piPhiName]
            Tuple.Decay = "[D_s+ -> ^pi+ (^phi(1020) => ^K+ ^K-)]cc"
            Tuple.Branches = {
                "pion": "[D_s+ -> ^pi+ (phi(1020) => K+ K-)]cc",
                "kaonplus": "[D_s+ -> pi+ (phi(1020) => ^K+ K-)]cc",
                "kaonminus": "[D_s+ -> pi+ (phi(1020) => K+ ^K-)]cc",
                "phi": "[D_s+ -> pi+ (^phi(1020) => K+ K-)]cc",
                "D_s": "[D_s+]cc :[D_s+ -> pi+ (phi(1020) => K+ K-)]cc"
            }

            Tuple.addTool(TupleToolDecay, name='pion')
            Tuple.addTool(TupleToolDecay, name='phi')
            Tuple.addTool(TupleToolDecay, name='kaonplus')
            Tuple.addTool(TupleToolDecay, name='kaonminus')
            Tuple.addTool(TupleToolDecay, name='D_s')

            # k+ specific
            kaonplusLoKiTool = LoKi__Hybrid__TupleTool('kaonplusLoKiTool')
            kaonplusLoKiTool.Variables = {
                "LOKI_PIDK": "PIDK",
                "LOKI_PIDe": "PIDe",
                "LOKI_PIDpi": "PIDpi",
                "LOKI_PIDp": "PIDp",
                "LOKI_PIDmu": "PIDmu",
                "LOKI_PIDK_PIDpi": "PIDK-PIDpi",
                "LOKI_PIDK_PIDe": "PIDK-PIDe",
                "LOKI_PIDK_PIDmu": "PIDK-PIDmu",
                "LOKI_PIDK_PIDp": "PIDK-PIDp"
            }

            Tuple.kaonplus.addTool(kaonplusLoKiTool, name='kaonplusLoKiTool')
            Tuple.kaonplus.ToolList = [
                'LoKi::Hybrid::TupleTool/kaonplusLoKiTool'
            ]

            # k- specific
            kaonminusLoKiTool = LoKi__Hybrid__TupleTool('kaonminusLoKiTool')
            kaonminusLoKiTool.Variables = {
                "LOKI_PIDK": "PIDK",
                "LOKI_PIDe": "PIDe",
                "LOKI_PIDpi": "PIDpi",
                "LOKI_PIDp": "PIDp",
                "LOKI_PIDmu": "PIDmu",
                "LOKI_PIDK_PIDpi": "PIDK-PIDpi",
                "LOKI_PIDK_PIDe": "PIDK-PIDe",
                "LOKI_PIDK_PIDmu": "PIDK-PIDmu",
                "LOKI_PIDK_PIDp": "PIDK-PIDp"
            }

            Tuple.kaonminus.addTool(kaonminusLoKiTool,
                                    name='kaonminusLoKiTool')
            Tuple.kaonminus.ToolList = [
                'LoKi::Hybrid::TupleTool/kaonminusLoKiTool'
            ]

            # pi+ specific
            pionLoKiTool = LoKi__Hybrid__TupleTool('pionLoKiTool')
            pionLoKiTool.Variables = {
                "LOKI_PIDK": "PIDK",
                "LOKI_PIDe": "PIDe",
                "LOKI_PIDpi": "PIDpi",
                "LOKI_PIDp": "PIDp",
                "LOKI_PIDmu": "PIDmu",
                "LOKI_PIDpi_PIDK": "PIDpi-PIDK",
                "LOKI_PIDpi_PIDe": "PIDpi-PIDe",
                "LOKI_PIDpi_PIDmu": "PIDpi-PIDmu",
                "LOKI_PIDpi_PIDp": "PIDpi-PIDp"
            }

            Tuple.pion.addTool(pionLoKiTool, name='pionLoKiTool')
            Tuple.pion.ToolList = ['LoKi::Hybrid::TupleTool/pionLoKiTool']

            # phi specific
            phiLoKiTool = LoKi__Hybrid__TupleTool('phiLoKiTool')
            phiLoKiTool.Variables = {}

            Tuple.phi.addTool(phiLoKiTool, name='phiLoKiTool')
            Tuple.phi.ToolList = ['LoKi::Hybrid::TupleTool/phiLoKiTool']

            # D_s specific
            DsLoKiTool = LoKi__Hybrid__TupleTool('DsLoKiTool')
            DsLoKiTool.Variables = {}

            Tuple.D_s.addTool(DsLoKiTool, name='DsLoKiTool')
            Tuple.D_s.ToolList = ["LoKi::Hybrid::TupleTool/DsLoKiTool"]

            # Common to all particles
            LoKiTool = LoKi__Hybrid__TupleTool('LoKiTool')
            LoKiTool.Variables = {
                "LOKI_ABSID": "ABSID",
                "LOKI_BPVIPCHI2": "BPVIPCHI2()",
                "LOKI_BPVDIRA": "BPVDIRA",
                "LOKI_BPVLTFITCHI2":
                "BPVLTFITCHI2('PropertimeFitter/properTime:PUBLIC')",
                "LOKI_BPVLTCHI2":
                "BPVLTCHI2('PropertimeFitter/properTime:PUBLIC')",
                "LOKI_BPVLTIME":
                "BPVLTIME('PropertimeFitter/properTime:PUBLIC')",
                "LOKI_BPVVDCHI2": "BPVVDCHI2",
                "LOKI_ID": "ID",
                "LOKI_MIPDV_PRIMARY": "MIPDV(PRIMARY)",
                "LOKI_MIPCHI2DV_PRIMARY": "MIPCHI2DV(PRIMARY)",
                "LOKI_MM": "MM",
                "LOKI_M": "M",
                "LOKI_P": "P",
                "LOKI_PT": "PT",
                "LOKI_TRCHI2": "TRCHI2",
                "LOKI_TRCHI2DOF": "TRCHI2DOF",
                "LOKI_VFASPF_VCHI2": "VFASPF(VCHI2)",
                "LOKI_VFASPF_VDOF": "VFASPF(VDOF)"
            }

            Tuple.addTool(LoKiTool, name='LoKiTool')
            Tuple.ToolList = [
                "LoKi::Hybrid::TupleTool/LoKiTool", "TupleToolEventInfo",
                "TupleToolGeometry", "TupleToolKinematic",
                "TupleToolMCBackgroundInfo", "TupleToolPid",
                "TupleToolPrimaries", "TupleToolTrackInfo",
                "TupleToolVtxIsoln", "TupleToolMCTruth"
            ]

            Tuple.addTool(TupleToolEventInfo)
            Tuple.TupleToolEventInfo.OutputLevel = outputLevel

            Tuple.addTool(TupleToolGeometry)
            Tuple.TupleToolGeometry.OutputLevel = outputLevel

            Tuple.addTool(TupleToolKinematic)
            Tuple.TupleToolKinematic.OutputLevel = outputLevel

            Tuple.addTool(TupleToolMCBackgroundInfo)
            Tuple.TupleToolMCBackgroundInfo.OutputLevel = outputLevel

            Tuple.addTool(MCTupleToolHierarchy)
            Tuple.MCTupleToolHierarchy.OutputLevel = outputLevel

            Tuple.addTool(TupleToolMCTruth)
            Tuple.TupleToolMCTruth.OutputLevel = outputLevel
            Tuple.TupleToolMCTruth.addTool(MCTupleToolKinematic())
            Tuple.TupleToolMCTruth.addTool(MCTupleToolHierarchy())
            Tuple.TupleToolMCTruth.ToolList = [
                "MCTupleToolKinematic", "MCTupleToolHierarchy"
            ]
            Tuple.TupleToolMCTruth.MCTupleToolKinematic.StoreKineticInfo = True
            Tuple.TupleToolMCTruth.MCTupleToolKinematic.StoreVertexInfo = True
            Tuple.TupleToolMCTruth.MCTupleToolKinematic.StorePropertimeInfo = True
            Tuple.TupleToolMCTruth.MCTupleToolKinematic.OutputLevel = outputLevel

            Tuple.addTool(TupleToolPid)
            Tuple.TupleToolPid.OutputLevel = outputLevel

            Tuple.addTool(TupleToolPrimaries)
            Tuple.TupleToolPrimaries.OutputLevel = outputLevel

            Tuple.addTool(TupleToolTrackInfo)
            Tuple.TupleToolTrackInfo.OutputLevel = outputLevel

            Tuple.addTool(TupleToolVtxIsoln)
            Tuple.TupleToolVtxIsoln.OutputLevel = outputLevel

            seq.Members += [Tuple]

            Tuple.NTupleLUN = "DSPHIPI"

            from Configurables import NTupleSvc
            NTupleSvc().Output = [
                "DSPHIPI DATAFILE='DsToPhiPi.root'  TYP='ROOT'  OPT='NEW'"
            ]
Example #26
0
    "Hlt2DiMuonDetachedHeavyDecision", "Hlt2DiMuonLowMassDecision",
    "Hlt2DiMuonJPsiDecision", "Hlt2DiMuonJPsiHighPTDecision",
    "Hlt2DiMuonPsi2SDecision", "Hlt2DiMuonBDecision"
]
TISTOSTool = TupleToolTISTOS('TISTOSTool')
TISTOSTool.VerboseL0 = True
TISTOSTool.VerboseHlt1 = True
TISTOSTool.VerboseHlt2 = True
TISTOSTool.TriggerList = triglist[:]
TISTOSTool.addTool(TriggerTisTos, name="TriggerTisTos")

LoKi_B = LoKi__Hybrid__TupleTool("LoKi_B")
LoKi_B.Variables = {
    "ETA": "ETA",
    "PHI": "PHI",
    "FDCHI2": "BPVVDCHI2",
    "FDS": "BPVDLS",
    "DIRA": "BPVDIRA",
    "pi0veto": "CHILDFUN ( PINFO( 25030 , -1 ) , 'gamma' == ABSID ) ",
}

LoKi_Mu = LoKi__Hybrid__TupleTool("LoKi_Mu")
LoKi_Mu.Variables = {"NSHAREDMU": "NSHAREDMU"}

tuple_B2Kmumu = DecayTreeTuple("Tuple")
tuple_B2Kmumu.Inputs = [location]
tuple_B2Kmumu.ToolList = tupletools[:]
tuple_B2Kmumu.Decay = '[Lambda_b0 -> ^(chi_c1(1P) -> ^(J/psi(1S) -> ^mu+ ^mu-) ^gamma) ^p+ ^K-]CC'
tuple_B2Kmumu.Branches = {
    "Lambda_b0":
    "[Lambda_b0 ->  (chi_c1(1P) ->  (J/psi(1S) ->  mu+  mu-)  gamma)  p+  K-]CC",
    "chi_c":
Example #27
0
def execute(stripRun, stripConf, stripLine, dataType, hltReport, tupleDecay, evtMax, mag, outputType="ntuple", strippingStream = "Charm"):

  #0 "pi" "pi"
  #1 "mu" "mu"
  #2 "K"  "pi"
  #3 "e"  "mu"
  #4 "K"  "mu"
  stripLines = {
    "kkpi":0,
    "kpipi":1,
    "pipipi":2,
    "kpipios":3,
    "kkk":4,
    "kkpios":5,
    "hhh":6,
    }

  lineNumber = stripLines[stripLine]

  # Now build the stream
  from StrippingConf.StrippingStream import StrippingStream
  ss = StrippingStream("ByTom")

  from StrippingSelections import StrippingD2hhh_conf
  line = False
  if stripConf == "default" or stripConf == "def":

    from StrippingArchive import Utils
    D2HHHConf, default_config = Utils.lineBuilderAndConf("stripping20","D2hhh")

    def_str_no_pre = default_config
    for key, val in def_str_no_pre.iteritems():
      if "Prescale" in key:
        def_str_no_pre[key] = 1.0

    D2HHHConf = StrippingD2hhh_conf.D2hhhConf('D2hhh',def_str_no_pre)
    D2hhhLines = D2HHHConf.lines()
    for line in D2hhhLines :
      print line.name(), line.outputLocation()

    ss.appendLines( [D2hhhLines[lineNumber]] )
    stripOutputLoc = D2hhhLines[lineNumber].outputLocation()
  else:
    raise ValueError("Unknown value of stripConf: %s"%stripConf)

  from StrippingConf.Configuration import StrippingConf
  conf = StrippingConf( Streams = [ ss ] )

  from Configurables import StrippingReport
  sr = StrippingReport(Selections = conf.selections())


  MessageSvc().Format = "% F%60W%S%7W%R%T %0W%M"

  from Configurables import DaVinci
  from Configurables import LoKi__HDRFilter as StripFilter

  strfilter = StripFilter( 'StripPassFilter', Code="HLT_PASS('"+D2hhhLines[lineNumber].name()+"Decision')", Location="/Event/Strip/Phys/DecReports" )
  #strfilter = StripFilter( 'StripPassFilter', Code="HLT_PASS('StrippingD2hhh_PPPLineDecision')", Location="/Event/Strip/Phys/DecReports" )
  DaVinci().EventPreFilters += [strfilter]

  DaVinci().PrintFreq = 500
  DaVinci().HistogramFile = 'DV_histos.root'
  DaVinci().TupleFile = "DPiPiPi_NTuple.root"
  DaVinci().EvtMax = evtMax

  storeExp = StoreExplorerAlg()
  storeExp.Load = 1
  storeExp.PrintFreq = 10.0

  #DaVinci().appendToMainSequence( [ storeExp ] )
  if stripRun:
    #from Configurables import bankKiller
    #bk = bankKiller( "KillHltBanks", BankTypes = [ "Evt/Strip/Phys/DecReports", "Evt/AllStreams" ] )
    #DaVinci().appendToMainSequence( [ bk ] )
    from Configurables import EventNodeKiller
    enk = EventNodeKiller()
    enk.Nodes=[
      "Event/Strip/Phys/DecReports",
      "Event/AllStreams"]
    DaVinci().appendToMainSequence( [ enk ] )
    #DaVinci().appendToMainSequence( [ storeExp ] )

    DaVinci().appendToMainSequence( [ conf.sequence() ] )
    DaVinci().appendToMainSequence( [ sr ] )
  if hltReport:
    from Configurables import ReadHltReport
    DaVinci().appendToMainSequence( [ ReadHltReport() ] )

  DaVinci().InputType = 'MDST'
  DaVinci().RootInTES = "/Event/Charm"

  a = "->"

  if dataType == "MC10":
    DaVinci().DataType = "2010"
    DaVinci().Simulation = True
    DaVinci().DDDBtag = "head-20101206"
    if mag == "up":
      DaVinci().CondDBtag = "sim-20101210-vc-mu100"
    elif mag == "down":
      DaVinci().CondDBtag = "sim-20101210-vc-md100"
    DaVinci().Lumi = False
  elif dataType == "MC11":
    DaVinci().DataType = "2011"
    DaVinci().Simulation = True
    DaVinci().DDDBtag = "MC11-20111102"
    if mag == "up":
      DaVinci().CondDBtag = "sim-20111111-vc-mu100"
    elif mag == "down":
      DaVinci().CondDBtag = "sim-20111111-vc-md100"
    DaVinci().Lumi = False
  elif dataType == "MC11a":
    DaVinci().DataType = "2011"
    DaVinci().Simulation = True
    DaVinci().DDDBtag = "MC11-20111102"
    if mag == "up":
      DaVinci().CondDBtag = "sim-20111111-vc-mu100"
    elif mag == "down":
      DaVinci().CondDBtag = "sim-20111111-vc-md100"
    DaVinci().Lumi = False
  elif dataType == "MC2012":
    DaVinci().DataType = "2012"
    DaVinci().Simulation = True
    DaVinci().DDDBtag = "Sim08-20130503-1"
    if mag == "up":
      DaVinci().CondDBtag = "Sim08-20130503-1-vc-mu100"
    elif mag == "down":
      DaVinci().CondDBtag = "Sim08-20130503-1-vc-md100"
    DaVinci().Lumi = False
  elif dataType == "MC2011":
    DaVinci().DataType = "2011"
    DaVinci().Simulation = True
    DaVinci().DDDBtag = "Sim08-20130503"
    if mag == "up":
      DaVinci().CondDBtag = "Sim08-20130503-vc-mu100"
    elif mag == "down":
      DaVinci().CondDBtag = "Sim08-20130503-vc-md100"
    DaVinci().Lumi = False
  elif dataType == "data2012":
    a = "->"
    DaVinci().DataType = "2012"
    DaVinci().Simulation = False
    #DaVinci().DDDBtag = "dddb-20130111"
    #if mag == "up":
      #DaVinci().CondDBtag = "cond-20130114"
    #elif mag == "down":
      #DaVinci().CondDBtag = "cond-20130114"
    DaVinci().Lumi = True
  elif dataType == "data2011":
    a = "->"
    DaVinci().DataType = "2011"
    DaVinci().Simulation = False
    #DaVinci().DDDBtag = "dddb-20130111"
    #if mag == "up":
      #DaVinci().CondDBtag = "cond-20130114"
    #elif mag == "down":
      #DaVinci().CondDBtag = "cond-20130114"
    DaVinci().Lumi = True
  elif dataType == "data":
    sys.exit("correct the dataType to include the year")


  from Configurables import DecayTreeTuple
  from Configurables import TupleToolTISTOS
  from Configurables import TupleToolMassHypo, TupleToolSubMass

  if outputType in ["ntuple", "nt", "tuple", "root"]:

    print "stripOutputLoc:",stripOutputLoc

    dttuple = DecayTreeTuple( "DPiPiPi_NTuple" )

    dttuple.ToolList = ["TupleToolGeometry",
                        "TupleToolEventInfo",
                        "TupleToolKinematic",
                        #"TupleToolPrimaries",
                        "TupleToolPropertime",
                        "TupleToolAngles",
                        "TupleToolPid",
                        #"TupleToolRICHPid",
                        "TupleToolDecay",
                        #"TupleToolTrigger",
                        #"TupleToolTrackPosition",
                        #"TupleToolTrackInfo",
                        #"TupleToolRecoStats",
                        "TupleToolDira",
                        "TupleToolDalitz",
                        "TupleToolSubMass",
                        ]

    dttuple.Inputs = [ stripOutputLoc ]

    print "tuple input :",dttuple.Inputs
    print "number of events:", DaVinci().EvtMax


    #[D+ -> pi- pi+ pi+]CC

    if tupleDecay == "pipipi":
      dttuple.Decay = "[D+ "+a+" ^pi- ^pi+ ^pi+]CC"
      dttuple.addBranches ({
        "D":   "[D+ "+a+" pi- pi+ pi+]CC",
        "x1": "[D+ "+a+" ^pi- pi+ pi+]CC",
        "x2": "[D+ "+a+" pi- ^pi+ pi+]CC",
        "x3": "[D+ "+a+" pi- pi+ ^pi+]CC",
        })
    elif tupleDecay == "kpipios":
      dttuple.Decay = "[D+ "+a+" ^pi- ^pi+ ^K+]CC"
      dttuple.addBranches ({
        "D":   "[D+ "+a+" pi- pi+ K+]CC",
        "x1": "[D+ "+a+" ^pi- pi+ K+]CC",
        "x2": "[D+ "+a+" pi- ^pi+ K+]CC",
        "x3": "[D+ "+a+" pi- pi+ ^K+]CC",
        })
    elif tupleDecay == "ds2phipi":
      dttuple.Decay = "[D+ "+a+" ^mu+ ^mu- ^pi+]CC"
      dttuple.addBranches ({
        "D":   "[D+ "+a+" mu+ mu- pi+]CC",
        "x1": "[D+ "+a+" ^mu+ mu- pi+]CC",
        "x2": "[D+ "+a+" mu+ ^mu- pi+]CC",
        "x3": "[D+ "+a+" mu+ mu- ^pi+]CC",
        })

    #if tupleDecay == "eta":
      #dttuple.Decay = "[(D+ "+a+" ^(eta "+a+" ^pi+ ^pi-) ^pi+),(D- "+a+" ^(eta "+a+" ^pi+ ^pi-) ^pi-)]"
      #dttuple.addBranches ({
        #"D":   "[(D+ "+a+" (eta "+a+" pi+ pi-) pi+),(D- "+a+" (eta "+a+" pi+ pi-) pi-)]",
        #"eta": "[(D+ "+a+" ^(eta "+a+" ^pi+ ^pi-) ^pi+),(D- "+a+" ^(eta "+a+" ^pi+ ^pi-) ^pi-)]",
        #"pip": "[(D+ "+a+" (eta "+a+" ^pi+ pi-) pi+),(D- "+a+" (eta "+a+" ^pi+ pi-) pi-)]",
        #"pim": "[(D+ "+a+" (eta "+a+" pi+ ^pi-) pi+),(D- "+a+" (eta "+a+" pi+ ^pi-) pi-)]",
        #"pi":  "[(D+ "+a+" (eta "+a+" pi+ pi-) ^pi+),(D- "+a+" (eta "+a+" pi+ pi-) ^pi-)]",
        #})

    dttuple.TupleName = "DPiPiPi_NTuple"

    ttmhk = TupleToolMassHypo("KaonHypo")
    ttmhk.PIDReplacements = { "pi+" : "K+"}
    #ttmhk.CC = True
    dttuple.D.addTool(ttmhk)
    dttuple.D.ToolList += ["TupleToolMassHypo/KaonHypo"]

    ttmhm = TupleToolMassHypo("MuonHypo")
    ttmhm.PIDReplacements = { "pi+" : "mu+"}
    #ttmhm.CC = True
    dttuple.D.addTool(ttmhm)
    dttuple.D.ToolList += ["TupleToolMassHypo/MuonHypo"]

    dttuple.addTool(TupleToolTISTOS())
    dttuple.TupleToolTISTOS.VerboseL0 = True
    dttuple.TupleToolTISTOS.VerboseHlt1 = True
    dttuple.TupleToolTISTOS.VerboseHlt2 = True
    dttuple.TupleToolTISTOS.Verbose = True
    dttuple.ToolList += ["TupleToolTISTOS"]

    dttuple.TupleToolTISTOS.TriggerList = [

        "L0CALODecision",
        "L0ElectronDecision",
        "L0PhotonDecision",
        "L0HadronDecision",
        "L0MuonDecision",

        "Hlt1TrackMuonDecision",
        "Hlt1TrackAllL0Decision",

        "Hlt2Topo2BodyBBDTDecision",
        "Hlt2Topo3BodyBBDTDecision",
        "Hlt2Topo4BodyBBDTDecision",

        'Hlt2CharmHadD2HHHDecision',

        ] #+ [ trigger_name+"Decision" for trigger_name in
          #      ["L0CALO","L0ElectronNoSPD","L0PhotonNoSPD","L0HadronNoSPD","L0MuonNoSPD","L0DiMuonNoSPD","L0Electron","L0ElectronHi","L0Photon","L0PhotonHi","L0Hadron","L0Muon","L0DiMuon","L0HighSumETJet","L0B1gas","L0B2gas",]\
          #    + ["Hlt1MBMicroBiasVelo","Hlt1Global","Hlt1DiMuonHighMass","Hlt1DiMuonLowMass","Hlt1SingleMuonNoIP","Hlt1SingleMuonHighPT","Hlt1TrackAllL0","Hlt1TrackMuon","Hlt1TrackPhoton","Hlt1Lumi","Hlt1LumiMidBeamCrossing","Hlt1MBNoBias","Hlt1MBMicroBiasVeloRateLimited","Hlt1MBMicroBiasTStation","Hlt1MBMicroBiasTStationRateLimited","Hlt1L0Any","Hlt1L0AnyRateLimited","Hlt1L0AnyNoSPD","Hlt1L0AnyNoSPDRateLimited","Hlt1NoPVPassThrough","Hlt1DiProton","Hlt1DiProtonLowMult","Hlt1BeamGasNoBeamBeam1","Hlt1BeamGasNoBeamBeam2","Hlt1BeamGasBeam1","Hlt1BeamGasBeam2","Hlt1BeamGasCrossingEnhancedBeam1","Hlt1BeamGasCrossingEnhancedBeam2","Hlt1BeamGasCrossingForcedReco","Hlt1ODINTechnical","Hlt1Tell1Error","Hlt1VeloClosingMicroBias","Hlt1BeamGasCrossingParasitic","Hlt1ErrorEvent","Hlt1SingleElectronNoIP","Hlt1TrackForwardPassThrough","Hlt1TrackForwardPassThroughLoose","Hlt1CharmCalibrationNoBias","Hlt1L0HighSumETJet","Hlt1BeamGasCrossingForcedRecoFullZ","Hlt1BeamGasHighRhoVertices","Hlt1VertexDisplVertex","Hlt1TrackAllL0Tight","Hlt1HighPtJetsSinglePV","Hlt1L0PU","Hlt1L0CALO",]\
          #    + ["Hlt2SingleElectronTFLowPt","Hlt2SingleElectronTFHighPt","Hlt2DiElectronHighMass","Hlt2DiElectronB","Hlt2B2HHLTUnbiased","Hlt2Topo2BodySimple","Hlt2Topo3BodySimple","Hlt2Topo4BodySimple","Hlt2Topo2BodyBBDT","Hlt2Topo3BodyBBDT","Hlt2Topo4BodyBBDT","Hlt2TopoMu2BodyBBDT","Hlt2TopoMu3BodyBBDT","Hlt2TopoMu4BodyBBDT","Hlt2TopoE2BodyBBDT","Hlt2TopoE3BodyBBDT","Hlt2TopoE4BodyBBDT","Hlt2IncPhi","Hlt2IncPhiSidebands","Hlt2CharmHadD02HHKsLL","Hlt2Dst2PiD02PiPi","Hlt2Dst2PiD02MuMu","Hlt2Dst2PiD02KMu","Hlt2Dst2PiD02KPi","Hlt2PassThrough","Hlt2Transparent","Hlt2Forward","Hlt2DebugEvent","Hlt2CharmHadD02HH_D02PiPi","Hlt2CharmHadD02HH_D02PiPiWideMass","Hlt2CharmHadD02HH_D02KK","Hlt2CharmHadD02HH_D02KKWideMass","Hlt2CharmHadD02HH_D02KPi","Hlt2CharmHadD02HH_D02KPiWideMass","Hlt2ExpressJPsi","Hlt2ExpressJPsiTagProbe","Hlt2ExpressLambda","Hlt2ExpressKS","Hlt2ExpressDs2PhiPi","Hlt2ExpressBeamHalo","Hlt2ExpressDStar2D0Pi","Hlt2ExpressHLT1Physics","Hlt2Bs2PhiGamma","Hlt2Bs2PhiGammaWideBMass","Hlt2Bd2KstGamma","Hlt2Bd2KstGammaWideKMass","Hlt2Bd2KstGammaWideBMass","Hlt2CharmHadD2KS0H_D2KS0Pi","Hlt2CharmHadD2KS0H_D2KS0K","Hlt2CharmRareDecayD02MuMu","Hlt2B2HH","Hlt2MuonFromHLT1","Hlt2SingleMuon","Hlt2SingleMuonHighPT","Hlt2SingleMuonLowPT","Hlt2DiProton","Hlt2DiProtonTF","Hlt2DiProtonLowMult","Hlt2DiProtonLowMultTF","Hlt2CharmSemilepD02HMuNu_D02KMuNuWS","Hlt2CharmSemilepD02HMuNu_D02PiMuNuWS","Hlt2CharmSemilepD02HMuNu_D02KMuNu","Hlt2CharmSemilepD02HMuNu_D02PiMuNu","Hlt2TFBc2JpsiMuX","Hlt2TFBc2JpsiMuXSignal","Hlt2DisplVerticesLowMassSingle","Hlt2DisplVerticesHighMassSingle","Hlt2DisplVerticesDouble","Hlt2DisplVerticesSinglePostScaled","Hlt2DisplVerticesHighFDSingle","Hlt2DisplVerticesSingleDown","Hlt2CharmSemilepD2HMuMu","Hlt2CharmSemilepD2HMuMuWideMass","Hlt2B2HHPi0_Merged","Hlt2CharmHadD2HHH","Hlt2CharmHadD2HHHWideMass","Hlt2DiMuon","Hlt2DiMuonLowMass","Hlt2DiMuonJPsi","Hlt2DiMuonJPsiHighPT","Hlt2DiMuonPsi2S","Hlt2DiMuonB","Hlt2DiMuonZ","Hlt2DiMuonDY1","Hlt2DiMuonDY2","Hlt2DiMuonDY3","Hlt2DiMuonDY4","Hlt2DiMuonDetached","Hlt2DiMuonDetachedHeavy","Hlt2DiMuonDetachedJPsi","Hlt2DiMuonNoPV","Hlt2TriMuonDetached","Hlt2TriMuonTau","Hlt2CharmSemilepD02HHMuMu","Hlt2CharmSemilepD02HHMuMuWideMass","Hlt2CharmHadD02HHHH","Hlt2CharmHadD02HHHHWideMass","Hlt2ErrorEvent","Hlt2Global","Hlt2diPhotonDiMuon","Hlt2LowMultMuon","Hlt2LowMultHadron","Hlt2LowMultPhoton","Hlt2LowMultElectron","Hlt2SingleTFElectron","Hlt2SingleTFVHighPtElectron","Hlt2B2HHLTUnbiasedDetached","Hlt2CharmHadLambdaC2KPPi","Hlt2SingleMuonVHighPT","Hlt2CharmSemilepD02HMuNu_D02KMuNuTight","Hlt2CharmHadMinBiasLambdaC2KPPi","Hlt2CharmHadMinBiasD02KPi","Hlt2CharmHadMinBiasD02KK","Hlt2CharmHadMinBiasDplus2hhh","Hlt2CharmHadMinBiasLambdaC2LambdaPi","Hlt2DisplVerticesSingle","Hlt2DisplVerticesDoublePostScaled","Hlt2DisplVerticesSingleHighMassPostScaled","Hlt2DisplVerticesSingleHighFDPostScaled","Hlt2DisplVerticesSingleMVPostScaled","Hlt2RadiativeTopoTrackTOS","Hlt2RadiativeTopoPhotonL0","Hlt2DiMuonPsi2SHighPT","Hlt2DoubleDiMuon","Hlt2DiMuonAndMuon","Hlt2DiMuonAndGamma","Hlt2DiMuonAndD0","Hlt2DiMuonAndDp","Hlt2DiMuonAndDs","Hlt2DiMuonAndLc","Hlt2CharmSemilepD02HHMuMuHardHadronsSoftMuons","Hlt2CharmSemilepD02HHMuMuHardHadronsSoftMuonsWideMass","Hlt2CharmSemilepD02HHMuMuHardHadronsAndMuons","Hlt2CharmSemilepD02HHMuMuHardHadronsAndMuonsWideMass","Hlt2TopoRad2BodyBBDT","Hlt2TopoRad2plus1BodyBBDT","Hlt2Lumi","Hlt2LowMultHadron_nofilter","Hlt2LowMultElectron_nofilter","Hlt2CharmHadD02HHKsDD","Hlt2CharmHadD2KS0KS0","Hlt2CharmHadD2KS0KS0WideMass","Hlt2ExpressD02KPi","Hlt2CharmHadLambdaC2KPPiWideMass","Hlt2CharmHadLambdaC2KPK","Hlt2CharmHadLambdaC2KPKWideMass","Hlt2CharmHadLambdaC2PiPPi","Hlt2CharmHadLambdaC2PiPPiWideMass","Hlt2CharmHadLambdaC2PiPK","Hlt2CharmHadLambdaC2PiPKWideMass","Hlt2CharmHadD2KS0H_D2KS0DDPi","Hlt2CharmHadD2KS0H_D2KS0DDK","Hlt2DiPhi","Hlt2CharmHadD02HHHHDstNoHltOne_4pi","Hlt2CharmHadD02HHHHDstNoHltOne_4piWideMass","Hlt2CharmHadD02HHHHDstNoHltOne_K3pi","Hlt2CharmHadD02HHHHDstNoHltOne_K3piWideMass","Hlt2CharmHadD02HHHHDstNoHltOne_KKpipi","Hlt2CharmHadD02HHHHDstNoHltOne_KKpipiWideMass","Hlt2CharmHadD02HHHHDstNoHltOne_2K2pi","Hlt2CharmHadD02HHHHDstNoHltOne_2K2piWideMass","Hlt2CharmHadD02HHHHDstNoHltOne_3Kpi","Hlt2CharmHadD02HHHHDstNoHltOne_3KpiWideMass","Hlt2CharmHadD02HHHHDstNoHltOne_Ch2","Hlt2CharmHadD02HHHHDstNoHltOne_Ch2WideMass","Hlt2CharmSemilep3bodyD2PiMuMu","Hlt2CharmSemilep3bodyD2PiMuMuSS","Hlt2CharmSemilep3bodyD2KMuMu","Hlt2CharmSemilep3bodyD2KMuMuSS","Hlt2CharmSemilep3bodyLambdac2PMuMu","Hlt2CharmSemilep3bodyLambdac2PMuMuSS","Hlt2LambdaC_LambdaC2Lambda0LLPi","Hlt2LambdaC_LambdaC2Lambda0LLK","Hlt2LambdaC_LambdaC2Lambda0DDPi","Hlt2LambdaC_LambdaC2Lambda0DDK","Hlt2RadiativeTopoTrack","Hlt2RadiativeTopoPhoton","Hlt2CharmHadD02HHHHDst_4pi","Hlt2CharmHadD02HHHHDst_4piWideMass","Hlt2CharmHadD02HHHHDst_K3pi","Hlt2CharmHadD02HHHHDst_K3piWideMass","Hlt2CharmHadD02HHHHDst_KKpipi","Hlt2CharmHadD02HHHHDst_KKpipiWideMass","Hlt2CharmHadD02HHHHDst_2K2pi","Hlt2CharmHadD02HHHHDst_2K2piWideMass","Hlt2CharmHadD02HHHHDst_3Kpi","Hlt2CharmHadD02HHHHDst_3KpiWideMass","Hlt2CharmHadD02HHHHDst_Ch2","Hlt2CharmHadD02HHHHDst_Ch2WideMass","Hlt2CharmSemilepD02PiPiMuMu","Hlt2CharmSemilepD02KKMuMu","Hlt2CharmSemilepD02KPiMuMu","Hlt2CharmHadD02HHHH_4pi","Hlt2CharmHadD02HHHH_4piWideMass","Hlt2CharmHadD02HHHH_K3pi","Hlt2CharmHadD02HHHH_K3piWideMass","Hlt2CharmHadD02HHHH_KKpipi","Hlt2CharmHadD02HHHH_KKpipiWideMass","Hlt2CharmHadD02HHHH_2K2pi","Hlt2CharmHadD02HHHH_2K2piWideMass","Hlt2CharmHadD02HHHH_3Kpi","Hlt2CharmHadD02HHHH_3KpiWideMass","Hlt2CharmHadD02HHHH_Ch2","Hlt2CharmHadD02HHHH_Ch2WideMass","Hlt2DiMuonDetachedPsi2S","Hlt2CharmHadD02HHXDst_hhX","Hlt2CharmHadD02HHXDst_hhXWideMass","Hlt2LowMultD2KPi","Hlt2LowMultD2KPiPi","Hlt2LowMultD2K3Pi","Hlt2LowMultChiC2HH","Hlt2LowMultChiC2HHHH","Hlt2LowMultD2KPiWS","Hlt2LowMultD2KPiPiWS","Hlt2LowMultD2K3PiWS","Hlt2LowMultChiC2HHWS","Hlt2LowMultChiC2HHHHWS","Hlt2LowMultDDInc","Hlt2DisplVerticesSingleLoosePS","Hlt2DisplVerticesSingleHighFD","Hlt2DisplVerticesSingleVeryHighFD","Hlt2DisplVerticesSingleHighMass","Hlt2DisplVerticesSinglePS","Hlt2DisplVerticesDoublePS","Hlt2CharmHadD2HHHKsLL","Hlt2CharmHadD2HHHKsDD","Hlt2KshortToMuMuPiPi","Hlt2LowMultChiC2PP","Hlt2LowMultDDIncCP","Hlt2LowMultDDIncVF","Hlt2LowMultLMR2HH","Hlt2HighPtJets","Hlt2ChargedHyperon_Xi2Lambda0LLPi","Hlt2ChargedHyperon_Xi2Lambda0LLMu","Hlt2ChargedHyperon_Omega2Lambda0LLK","Hlt2ChargedHyperon_Xi2Lambda0DDPi","Hlt2ChargedHyperon_Xi2Lambda0DDMu","Hlt2ChargedHyperon_Omega2Lambda0DDK","Hlt2CharmHadD02HHXDst_BaryonhhX","Hlt2CharmHadD02HHXDst_BaryonhhXWideMass","Hlt2CharmHadD02HHXDst_BaryonhhXWithKSLL","Hlt2CharmHadD02HHXDst_BaryonhhXWithKSLLWideMass","Hlt2CharmHadD02HHXDst_BaryonhhXWithLambda0LL","Hlt2CharmHadD02HHXDst_BaryonhhXWithLambda0LLWideMass","Hlt2CharmHadD02HHXDst_BaryonhhXWithKSDD","Hlt2CharmHadD02HHXDst_BaryonhhXWithKSDDWideMass","Hlt2CharmHadD02HHXDst_BaryonhhXWithLambda0DD","Hlt2CharmHadD02HHXDst_BaryonhhXWithLambda0DDWideMass","Hlt2CharmHadD02HHXDst_LeptonhhX","Hlt2CharmHadD02HHXDst_LeptonhhXWideMass","Hlt2CharmHadD02HHXDst_LeptonhhXWithKSLL","Hlt2CharmHadD02HHXDst_LeptonhhXWithKSLLWideMass","Hlt2CharmHadD02HHXDst_LeptonhhXWithLambda0LL","Hlt2CharmHadD02HHXDst_LeptonhhXWithLambda0LLWideMass","Hlt2CharmHadD02HHXDst_LeptonhhXWithKSDD","Hlt2CharmHadD02HHXDst_LeptonhhXWithKSDDWideMass","Hlt2CharmHadD02HHXDst_LeptonhhXWithLambda0DD","Hlt2CharmHadD02HHXDst_LeptonhhXWithLambda0DDWideMass"]
          #  ]

    from Configurables import LoKi__Hybrid__TupleTool
    LoKi_DTFMASS = LoKi__Hybrid__TupleTool("LoKi_DTFMASS")
    LoKi_DTFMASS.Variables = {
        "DTF_CHI2"   : "DTF_CHI2( True )",
        "DTF_NDOF"   : "DTF_NDOF( True )",

        "DTF_D_M"     : "DTF_FUN ( M ,                      True )",
        "DTF_D_MM"    : "DTF_FUN ( MM ,                     True )",
        "DTF_D_P"     : "DTF_FUN ( P ,                      True )",
        "DTF_D_PT"    : "DTF_FUN ( PT ,                     True )",
        "DTF_D_PE"    : "DTF_FUN ( E ,                      True )",
        "DTF_D_PX"    : "DTF_FUN ( PX ,                     True )",
        "DTF_D_PY"    : "DTF_FUN ( PY ,                     True )",
        "DTF_D_PZ"    : "DTF_FUN ( PZ ,                     True )",

        "DTF_x1_M"   : "DTF_FUN ( CHILD(M,1) ,             True )",
        "DTF_x1_MM"  : "DTF_FUN ( CHILD(MM,1) ,            True )",
        "DTF_x1_P"   : "DTF_FUN ( CHILD(P,1) ,             True )",
        "DTF_x1_PT"  : "DTF_FUN ( CHILD(PT,1) ,            True )",
        "DTF_x1_PE"  : "DTF_FUN ( CHILD(E,1) ,             True )",
        "DTF_x1_PX"  : "DTF_FUN ( CHILD(PX,1) ,            True )",
        "DTF_x1_PY"  : "DTF_FUN ( CHILD(PY,1) ,            True )",
        "DTF_x1_PZ"  : "DTF_FUN ( CHILD(PZ,1) ,            True )",

        "DTF_x2_M"   : "DTF_FUN ( CHILD(M,2) ,             True )",
        "DTF_x2_MM"  : "DTF_FUN ( CHILD(MM,2) ,            True )",
        "DTF_x2_P"   : "DTF_FUN ( CHILD(P,2) ,             True )",
        "DTF_x2_PT"  : "DTF_FUN ( CHILD(PT,2) ,            True )",
        "DTF_x2_PE"  : "DTF_FUN ( CHILD(E,2) ,             True )",
        "DTF_x2_PX"  : "DTF_FUN ( CHILD(PX,2) ,            True )",
        "DTF_x2_PY"  : "DTF_FUN ( CHILD(PY,2) ,            True )",
        "DTF_x2_PZ"  : "DTF_FUN ( CHILD(PZ,2) ,            True )",

        "DTF_x3_M"   : "DTF_FUN ( CHILD(M,3) ,             True )",
        "DTF_x3_MM"  : "DTF_FUN ( CHILD(MM,3) ,            True )",
        "DTF_x3_P"   : "DTF_FUN ( CHILD(P,3) ,             True )",
        "DTF_x3_PT"  : "DTF_FUN ( CHILD(PT,3) ,            True )",
        "DTF_x3_PE"  : "DTF_FUN ( CHILD(E,3) ,             True )",
        "DTF_x3_PX"  : "DTF_FUN ( CHILD(PX,3) ,            True )",
        "DTF_x3_PY"  : "DTF_FUN ( CHILD(PY,3) ,            True )",
        "DTF_x3_PZ"  : "DTF_FUN ( CHILD(PZ,3) ,            True )",

        }
    dttuple.D.ToolList+=["LoKi::Hybrid::TupleTool/LoKi_DTFMASS"]
    dttuple.D.addTool(LoKi_DTFMASS)

    if "MC" in dataType:
      from Configurables import TupleToolMCBackgroundInfo
      dttuple.addTool(TupleToolMCBackgroundInfo, name="TupleToolMCBackgroundInfo")
      dttuple.TupleToolMCBackgroundInfo.Verbose=True
      dttuple.addTool(TupleToolMCTruth, name="truth")
      dttuple.truth.ToolList += ["MCTupleToolHierarchy",
                                "MCTupleToolKinematic"]
      dttuple.ToolList+=["TupleToolMCBackgroundInfo/TupleToolMCBackgroundInfo"]
      dttuple.ToolList+=["TupleToolMCTruth/truth"]

    DaVinci().appendToMainSequence( [ dttuple ] )

  elif outputType == "dst":

    from Configurables import SelDSTWriter
    if stripRun:
      dst_Sel = AutomaticData(Location = stripOutputLoc)
    else:
      dst_Sel = AutomaticData(Location = "/Event/"+strippingStream+"/" + stripOutputLoc)

    dst_Filter = FilterDesktop('dst_Filter', Code = "ALL")

    dst_FilterSel = Selection(name = line.name().replace("Stripping",""),
                              Algorithm = dst_Filter,
                              RequiredSelections = [ dst_Sel ])

    dst_Seq = SelectionSequence('lsdata',
                                TopSelection = dst_FilterSel,
                                )

    dstw = SelDSTWriter("DSTWriter")
    dstw.OutputFileSuffix = "PiPiPi"
    #dstw.CopyProtoParticles = False
    dstw.SelectionSequences = [dst_Seq]
    #dstw.CopyL0DUReport = False
    #dstw.CopyHltDecReports = False
    #dstw.CopyMCTruth = True
    #dstw.CopyBTags = True
    DaVinci().appendToMainSequence( [ dstw.sequence() ] )