21import modularAnalysis
as ma
26my_path = b2.create_path()
29ma.inputMdst(filename=b2.find_file(
'B2pi0D_D2hh_D2hhh_B2munu.root',
'examples',
False),
34ma.fillParticleListFromMC(decayString=
'pi+:gen', cut=
'', path=my_path)
37weight_table_id =
"ParticleReweighting:TestMomentum"
39if not os.getenv(
'BELLE2_EXAMPLES_DATA_DIR'):
40 b2.B2FATAL(
"You need the example data installed. Run `b2install-data example` in terminal for it.")
42db_location = os.getenv(
'BELLE2_EXAMPLES_DATA_DIR') +
'/database/'
43b2.conditions.prepend_testing_payloads(db_location +
'database.txt')
47va.variables.addAlias(
'Weight',
'extraInfo(' + weight_table_id +
'_Weight)')
48va.variables.addAlias(
'StatErr',
'extraInfo(' + weight_table_id +
'_StatErr)')
49va.variables.addAlias(
'SystErr',
'extraInfo(' + weight_table_id +
'_SystErr)')
50va.variables.addAlias(
'binID',
'extraInfo(' + weight_table_id +
'_binID)')
54reweighter = b2.register_module(
'ParticleWeighting')
55reweighter.param(
'tableName', weight_table_id)
56reweighter.param(
'particleList',
'pi+:gen')
57my_path.add_module(reweighter)
60pivars = [
'p',
'pz',
'Weight',
'StatErr',
'SystErr',
'binID']
63output_file =
'B2A905-ApplyWeightsToTracks.root'
64ma.variablesToNtuple(decayString=
'pi+:gen',