Belle II Software  release-08-01-10
B_converted_train.py
1 #!/usr/bin/env python3
2 
3 
10 
11 # Example which can be used to train the FEI
12 
13 import os
14 
15 import basf2 as b2
16 import modularAnalysis as ma
17 
18 import b2biiConversion
19 
20 import fei
21 
22 # To properly read the Belle database the user name is set to g0db
23 os.environ['PGUSER'] = 'g0db'
24 # Get FEI default channels for Belle conversion
25 # Utilise the arguments to toggle on and off certain channels
26 particles = fei.get_default_channels()
27 
28 # Set up FEI configuration specifying the FEI prefix
29 configuration = fei.config.FeiConfiguration(prefix='FEI_TEST', training=True)
30 
31 # Get FEI path
32 feistate = fei.get_path(particles, configuration)
33 
34 # Create Path
35 path = b2.create_path()
36 
37 # Apply conversion initially
38 if feistate.stage <= 0:
40  b2.find_file(
41  'analysis/mdstBelle1_exp65_charged.root',
42  'validation',
43  False),
44  applySkim=True,
45  # Actually, the KS finder should be set to True.
46  # However, here it's set to False because the necessary library is only present on kekcc and not on the build server.
47  enableNisKsFinder=False,
48  # Set this argument to True (default value) so that the local database on KEKCC is used.
49  # It's only set to False here so that this example can be run on bamboo.
50  enableLocalDB=False,
51  path=path)
52 else:
53  ma.inputMdstList('Belle', [], path)
54 
55 # Add FEI path to the path to be processed
56 path.add_path(feistate.path)
57 
58 # Add RootOutput to save particles reconstructing during the training stage
59 path.add_module('RootOutput')
60 
61 print(path)
62 b2.process(path)
def convertBelleMdstToBelleIIMdst(inputBelleMDSTFile, applySkim=True, saveResultExtraInfo=False, useBelleDBServer=None, convertBeamParameters=True, generatorLevelReconstruction=False, generatorLevelMCMatching=False, path=None, entrySequences=None, matchType2E9oE25Threshold=-1.1, enableNisKsFinder=True, HadronA=True, HadronB=True, enableRecTrg=False, enableEvtcls=True, SmearTrack=2, enableLocalDB=True, convertNbar=False)