Belle II Software  release-08-01-10
ecl_variables.py
1 #!/usr/bin/env python3
2 
9 
10 """
11 A test of the ECL variables using a recently produced mDST file.
12 The mDST file contains 3 B0 -> [ J/psi -> mu+ mu- ] [ K_S0 -> pi+ pi- ] events, BGx0.
13 """
14 
15 import b2test_utils
16 import basf2 as b2
17 
18 # make logging more reproducible by replacing some strings
20 b2.set_random_seed("1337")
21 
22 testinput = [b2test_utils.require_file(f"{b2.find_file('analysis/tests')}/ecl-rec-mdst-test.root")]
23 
24 fsps = ['gamma:all']
25 
26 testpath = b2.create_path()
27 testpath.add_module('RootInput', inputFileNames=testinput)
28 
29 ecl_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
71 testpath.add_module('ParticleLoader', decayStrings=['pi+:all'])
72 
73 for 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)
78 b2.process(testpath, 1)
def configure_logging_for_tests(user_replacements=None)
Definition: __init__.py:106
def require_file(filename, data_type="", py_case=None)
Definition: __init__.py:54