本文整理汇总了Python中Configurables.DaVinci.write_script方法的典型用法代码示例。如果您正苦于以下问题:Python DaVinci.write_script方法的具体用法?Python DaVinci.write_script怎么用?Python DaVinci.write_script使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Configurables.DaVinci
的用法示例。
在下文中一共展示了DaVinci.write_script方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: CHILD
# 需要导入模块: from Configurables import DaVinci [as 别名]
# 或者: from Configurables.DaVinci import write_script [as 别名]
'mppipi' : 'WMASS("p+", "pi-", "pi+")',
'mKK' : '((({kmass}**2 + CHILD(P2, 1))**.5 + CHILD(E, 2))**2 - (CHILD(PX, 1) + CHILD(PX, 2))**2 - (CHILD(PY, 1) + CHILD(PY, 2))**2 - (CHILD(PZ, 1) + CHILD(PZ, 2))**2)**.5'.format(kmass = kmass),
}
xcfuncs.update(funcs)
for vtxname, vtx in ('Vtx', True), ('NoVtx', False) :
for massname, massconst in ('NoMass', []), ('XcMass', [xcname]), ('XbMass', [xbname]), ('BothMass', [xbname, xcname]) :
pref = vtxname + '_' + massname
variables = {}
for name, func in funcs.iteritems() :
variables[pref + name] = func
for name, func in xcfuncs.iteritems() :
variables[pref + '_Xc_' + name] = 'CHILD({0}, 1)'.format(func)
# Couldn't find LoKi functors for, eg lifetime wrt origin vertex rather than PV.
for dttname, dtt in dtts.iteritems() :
dtt.X_b0.addTupleTool(make_dtf_tupletool('Xb_lokituple_' + pref + dttname,
vtx, massconst, variables))
dtt.X_b0.addTupleTool(TupleToolDecayTreeFitter(pref + dttname,
constrainToOriginVertex = vtx,
daughtersToConstrain = massconst,
Verbose = True))
fname = args.outputfile
dv.write_script(fname)
print 'Created', fname
return fname
if __name__ == '__main__' :
main()