Belle II Software  light-2212-foldex
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 import basf2 as b2
11 
12 # make logging more reproducible by replacing some strings
14 b2.set_random_seed("1337")
15 
16 testinput = [b2test_utils.require_file(f"{b2.find_file('analysis/tests')}/ecl-rec-mdst-test.root")]
17 
18 fsps = ['gamma:all']
19 
20 testpath = b2.create_path()
21 testpath.add_module('RootInput', inputFileNames=testinput)
22 
23 ecl_vars = [
24  'clusterPulseShapeDiscriminationMVA',
25  'clusterHasPulseShapeDiscrimination',
26  'clusterNumberOfHadronDigits',
27  'clusterDeltaLTemp',
28  'minC2TDist',
29  'nECLClusterTrackMatches',
30  'clusterZernikeMVA',
31  'clusterReg',
32  'clusterAbsZernikeMoment40',
33  'clusterAbsZernikeMoment51',
34  'clusterBelleQuality',
35  'clusterClusterID',
36  'clusterConnectedRegionID',
37  'clusterE1E9',
38  'clusterE9E21',
39  'clusterE9E25',
40  'clusterEoP',
41  'clusterErrorE',
42  'clusterErrorPhi',
43  'clusterErrorTheta',
44  'clusterErrorTiming',
45  'clusterHighestE',
46  'clusterHasFailedErrorTiming',
47  'clusterHasFailedTiming',
48  'clusterHasNPhotons',
49  'clusterHasNeutralHadron',
50  'clusterLAT',
51  'clusterNHits',
52  'clusterPhi',
53  'clusterR',
54  'clusterSecondMoment',
55  'clusterTheta',
56  'clusterTiming',
57  'clusterTrackMatch',
58  'goodBelleGamma',
59  'minC2TDistID',
60  'minC2TDistVar(p)',
61  'minC2TDistVar(cosTheta,pi+:all)'
62 ]
63 
64 # Load pi-:all for minC2TDistVar
65 testpath.add_module('ParticleLoader', decayStrings=['pi+:all'])
66 
67 for fsp in fsps:
68  testpath.add_module('ParticleLoader', decayStrings=[fsp])
69  testpath.add_module('ParticleSelector', decayString=fsp, cut='isFromECL')
70  testpath.add_module('ParticlePrinter', listName=fsp, fullPrint=False,
71  variables=ecl_vars)
72 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