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