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