本文整理匯總了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()