def test_automatic_data():
    sel00 = AutomaticData(Location='Phys/Sel00x')
    assert sel00.name() == 'Phys_Sel00x'
    assert sel00.algorithm().name() == 'SelFilterPhys_Sel00x'
    assert sel00.outputLocation() == 'Phys/Sel00x'

    sel00 = AutomaticData(Location='Phys/Sel00x/Particles')
    assert sel00.name() == 'Phys_Sel00x_Particles'
    assert sel00.algorithm().name() == 'SelFilterPhys_Sel00x_Particles'
    assert sel00.outputLocation() == 'Phys/Sel00x/Particles'
def test_VoidEventSelection():
    sel00 = AutomaticData(Location='Phys/Sel00x/Particles')
    ves00 = VoidEventSelection('VES00',
                               Code='Test (<Location>) > X',
                               RequiredSelection=sel00)
    assert sel00.outputLocation() == ves00.outputLocation()
    assert ves00.outputLocation() == 'Phys/Sel00x/Particles'
    assert ves00.algorithm().Code == "Test ('Phys/Sel00x/Particles') > X"
def test_outputLocation():
    sel00 = AutomaticData(Location='Phys/Sel00/Particles')
    assert sel00.outputLocation() == 'Phys/Sel00/Particles'
    alg0 = MockConfGenerator()
    sel0 = Selection('SomeName001', Algorithm=alg0)
    assert sel0.outputLocation() == 'Phys/SomeName001/Particles'
    sel1 = Selection('SomeName002',
                     OutputBranch='HLT2',
                     Algorithm=alg0,
                     Extension='HltParticles')
    assert sel1.outputLocation() == 'HLT2/SomeName002/HltParticles'
Example #4
0
stripfilter = FilterDesktop("stripfilter",
                             Preambulo = ["from LoKiPhysMC.decorators import *",
                                          "from LoKiPhysMC.functions import mcMatch"],
                             Code = "ALL")

inclmumu = Selection ("Sel"+name,
                     Algorithm = stripfilter,
                     RequiredSelections = [stripsel])
seq = SelectionSequence("seq",
                      TopSelection = inclmumu)


tuple = DecayTreeTuple("Incl_Tuple")

tuple.Inputs = [stripsel.outputLocation()]
tuple.ToolList =  [
      "TupleToolKinematic"
    , "TupleToolEventInfo"
    , "TupleToolRecoStats"
    , "TupleToolMCBackgroundInfo"
    , "TupleToolGeometry"
    , "TupleToolPid"
    , "TupleToolPropertime"
    , "TupleToolPrimaries"
    , "TupleToolTrackInfo"
]
MCtruth = tuple.addTupleTool("TupleToolMCTruth")
MCtruth.addTupleTool("LoKi::Hybrid::MCTupleTool/LoKi_Photos").Variables = {
    "nPhotons"  : "MCNINTREE(('gamma' == MCABSID))",
    "photons_TRUEP_X" : "MCSUMTREE(MCPX,('gamma' == MCABSID))", 
print "ALL OK"


rootintes = "/Event/AllStreams"
#---------------------------
# Run fixing XmumuLine
#---------------------------
from Configurables import NeutrinoBuildTupleTool, PromptNeutrinoTupleTool

tuple = DecayTreeTuple('PromptNeutrinoTupleTool')
tuple.OutputLevel = INFO

stream = 'AllStreams'
stripping_line = 'B2XMuMu_Line'

tuple.Inputs = [StripSel1.outputLocation()]
tuple.Decay = "[B+  -> ^( J/psi(1S)  -> ^mu-  ^mu+ ) ^pi+]CC"
tuple.addBranches({
    "B"       : "[B+ -> ( J/psi(1S)  -> mu-  mu+ ) pi+ ]CC",
    "Jpsi"    : "[B+ -> ^(J/psi(1S)  -> mu-  mu+) pi+]CC",
    "mu_prim" : "[B+ -> (J/psi(1S) -> mu- ^mu+) pi+]CC",
    "mu_sec"  : "[B+ -> (J/psi(1S) -> ^mu- mu+) pi+]CC",
    "pi"      : "[B+ -> (J/psi(1S) -> mu- mu+) ^pi+]CC",
    })

tuple.ToolList = [
    "TupleToolKinematic",
    "TupleToolPid",
    "TupleToolGeometry",
    "TupleToolPrimaries",
    "TupleToolTrackInfo",
Example #6
0
stripsel = AutomaticData(Location = "Phys/B2XMuMu_Line/Particles")


_stripfilter = FilterDesktop("stripfilter",
  		      Preambulo = ["from LoKiPhysMC.decorators import *","from LoKiPhysMC.functions import mcMatch"],
                      Code = "mcMatch('[B+]cc')")

Bu_Kmumu = Selection ("Sel"+name,
                     Algorithm = _stripfilter,
                     RequiredSelections = [stripsel])
seq = SelectionSequence("seq",
                      TopSelection = Bu_Kmumu)

tuple = DecayTreeTuple("Jpsi_Tuple")

tuple.Inputs = [stripsel.outputLocation()]


tuple.ToolList =  [
      "TupleToolKinematic"
    , "TupleToolEventInfo"
    , "TupleToolRecoStats"
    , "TupleToolMCTruth"
    , "TupleToolMCBackgroundInfo"
    , "TupleBuKmmFit"
]


tuple.addBranches ({         
      "Kplus" :  "[B+ -> ^K+ (J/psi(1S) -> mu+ mu-)]CC",
      "Jpsi" :  "[B+ -> K+ ^(J/psi(1S) -> mu+ mu-)]CC",