Belle II Software  release-05-01-25
test_shower2cluster.py
1 #!/usr/bin/env python3
2 # -*- coding: utf-8 -*-
3 
4 # basf2 test_shower2cluster.py
5 # input file is /home/belle2/harat/MCsample/mixed_e0001r0001_s00_BGx1.mdst.root
6 # Output file is shower2cluster.root
7 
8 from basf2 import *
9 from modularAnalysis import *
10 
11 import sys
12 
13 main = create_path()
14 
15 # This is the module for ECLShower to ECLCluster
16 showertocluster = register_module('ECLShowertoCluster')
17 
18 rootinput = register_module('RootInput')
19 # now both files below work
20 inFileROOT = \
21  '/home/belle2/harat/MCsample/charged_e0001r0001_s00_BGx1.mdst.root'
22 # inFileROOT = '/home/belle2/harat/MCsample/mixed_e0001r0001_s00_BGx1.mdst.root'
23 
24 rootinput.param('inputFileName', inFileROOT)
25 main.add_module(rootinput)
26 main.add_module(showertocluster)
27 
28 particleLoader = register_module('ParticleLoader')
29 main.add_module(particleLoader)
30 
31 # Save ECLCluster in rootfile
32 output = register_module('RootOutput')
33 outFileROOT = 'shower2cluster.root'
34 output.param('outputFileName', outFileROOT)
35 branches = ['ECLShowers', 'ECLClusters', 'ECLClustersToTracks',
36  'ECLClustersToMCParticles']
37 branches += ['MCParticles', 'Tracks']
38 output.param('branchNames', branches)
39 main.add_module(output)
40 
41 # ----> start processing of modules
42 process(main)
43 
44 # ----> Print call statistics
45 print(statistics)