12A test of the ParticleLoader using a relatively large test file
13(mdst14.root in the validation data)
21basf2.set_random_seed(
"1337")
23fsps = [
'e+',
'pi+',
'K+',
'p+',
'mu+',
'K_S0 -> pi+ pi-',
'Lambda0 -> p+ pi-',
'K_L0',
'gamma',
'n0']
27testpath = basf2.create_path()
29testpath.add_module(
'RootInput', inputFileName=inputFile)
31 testpath.add_module(
'ParticleLoader', decayStrings=[fsp])
32testpath.add_module(
'ParticleListManipulator', outputListName=
'gamma',
33 inputListNames=[
'gamma:all'], cut=
'isFromECL')
36for i
in range(len(fsps)):
38 fsps[i] = fsps[i].split(
' ->', 1)[0]
41mcps = [particle +
':MC' for particle
in fsps + [
'B0',
'D0']]
42testpath.add_module(
'ParticleLoader', decayStrings=mcps, useMCParticles=
True)
45testpath.add_module(
'ParticleListManipulator', outputListName=
'gamma:fromKLM',
46 inputListNames=[
'gamma:all'], cut=
'isFromKLM')
49signal_side =
'K_S0:V0'
50roe_side =
'Upsilon(4S):ROE'
51testpath.add_module(
'RestOfEventBuilder', particleList=signal_side,
52 particleListsInput=[
'pi+:all',
'gamma',
'K_L0:all'])
54testpath.add_module(
'ParticleLoader', decayStrings=[roe_side],
55 sourceParticleListName=signal_side, useROEs=
True)
57for i
in range(len(fsps)):
58 if 'K_S0' in fsps[i]
or 'Lambda0' in fsps[i]:
59 fsps[i] = fsps[i] +
':V0'
60 elif "gamma" not in fsps[i]:
61 fsps[i] = fsps[i] +
':all'
63testpath.add_module(
'ParticleStats', particleLists=fsps)
64testpath.add_module(
'ParticleStats', particleLists=mcps)
65testpath.add_module(
'ParticleStats', particleLists=[
'gamma:fromKLM'])
66testpath.add_module(
'ParticleStats', particleLists=[roe_side])
67basf2.process(testpath)
71 testpath.add_module(
'ParticlePrinter', listName=fsp, fullPrint=
True)
72testpath.add_module(
'ParticlePrinter', listName=
'gamma:fromKLM', fullPrint=
True)
73basf2.process(testpath, 1)
def require_file(filename, data_type="", py_case=None)
def configure_logging_for_tests(user_replacements=None)