Belle II Software  release-08-01-10
B_generic_train.py
1 #!/usr/bin/env python3
2 
3 
10 
11 import fei
12 import basf2 as b2
13 import modularAnalysis as ma
14 
15 # create path
16 path = b2.create_path()
17 
18 # Load input ROOT file
19 ma.inputMdst(filename=b2.find_file('mdst14.root', 'validation', False),
20  path=path)
21 
22 # Get FEI default channels.
23 # Utilise the arguments to toggle on and off certain channels
24 particles = fei.get_default_channels()
25 
26 # Set up FEI configuration specifying the FEI prefix
27 configuration = fei.config.FeiConfiguration(prefix='FEI_TEST', training=True, cache=-1)
28 
29 # Get FEI path
30 feistate = fei.get_path(particles, configuration)
31 
32 # Add FEI path to the path to be processed
33 path.add_path(feistate.path)
34 
35 # Add RootOutput to save particles reconstructing during the training stage
36 path.add_module('RootOutput')
37 
38 # Process 100 events
39 b2.process(path, max_event=100)