Belle II Software  release-06-02-00
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(environmentType='default',
20  filename=b2.find_file('mdst14.root', 'validation', False),
21  path=path)
22 
23 # Get FEI default channels.
24 # Utilise the arguments to toggle on and off certain channels
25 particles = fei.get_default_channels()
26 
27 # Set up FEI configuration specifying the FEI prefix
28 configuration = fei.config.FeiConfiguration(prefix='FEI_TEST', training=True, cache=-1)
29 
30 # Get FEI path
31 feistate = fei.get_path(particles, configuration)
32 
33 # Add FEI path to the path to be processed
34 path.add_path(feistate.path)
35 
36 # Add RootOutput to save particles reconstructing during the training stage
37 path.add_module('RootOutput')
38 
39 # Process 100 events
40 b2.process(path, max_event=100)