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