Belle II Software light-2406-ragdoll
ecl_variables.py
1#!/usr/bin/env python3
2
9
10"""
11A test of the ECL variables using a recently produced mDST file.
12The mDST file contains 3 B0 -> [ J/psi -> mu+ mu- ] [ K_S0 -> pi+ pi- ] events, BGx0.
13"""
14
15import b2test_utils
16import basf2 as b2
17
18# make logging more reproducible by replacing some strings
20b2.set_random_seed("1337")
21
22testinput = [b2test_utils.require_file(f"{b2.find_file('analysis/tests')}/ecl-rec-mdst-test.root")]
23
24fsps = ['gamma:all']
25
26testpath = b2.create_path()
27testpath.add_module('RootInput', inputFileNames=testinput)
28
29ecl_vars = [
30 'clusterPulseShapeDiscriminationMVA',
31 'clusterHasPulseShapeDiscrimination',
32 'clusterNumberOfHadronDigits',
33 'clusterDeltaLTemp',
34 'minC2TDist',
35 'nECLClusterTrackMatches',
36 'clusterZernikeMVA',
37 'clusterReg',
38 'clusterAbsZernikeMoment40',
39 'clusterAbsZernikeMoment51',
40 'clusterBelleQuality',
41 'clusterClusterID',
42 'clusterConnectedRegionID',
43 'clusterE1E9',
44 'clusterE9E21',
45 'clusterE9E25',
46 'clusterEoP',
47 'clusterErrorE',
48 'clusterErrorPhi',
49 'clusterErrorTheta',
50 'clusterErrorTiming',
51 'clusterHighestE',
52 'clusterHasFailedErrorTiming',
53 'clusterHasFailedTiming',
54 'clusterHasNPhotons',
55 'clusterHasNeutralHadron',
56 'clusterLAT',
57 'clusterNHits',
58 'clusterPhi',
59 'clusterR',
60 'clusterSecondMoment',
61 'clusterTheta',
62 'clusterTiming',
63 'clusterTrackMatch',
64 'goodBelleGamma',
65 'minC2TDistID',
66 'minC2TDistVar(p)',
67 'minC2TDistVar(cosTheta,pi+:all)'
68]
69
70# Load pi-:all for minC2TDistVar
71testpath.add_module('ParticleLoader', decayStrings=['pi+:all'])
72
73for fsp in fsps:
74 testpath.add_module('ParticleLoader', decayStrings=[fsp])
75 testpath.add_module('ParticleSelector', decayString=fsp, cut='isFromECL')
76 testpath.add_module('ParticlePrinter', listName=fsp, fullPrint=False,
77 variables=ecl_vars)
78b2.process(testpath, 1)
def require_file(filename, data_type="", py_case=None)
Definition: __init__.py:54
def configure_logging_for_tests(user_replacements=None)
Definition: __init__.py:106