mT2_packages.py 文件源码

python
阅读 27 收藏 0 点赞 0 评论 0

项目:LHC_recast 作者: kazuki-sakurai 项目源码 文件源码
def MT2_wrapper(m1, p1x, p1y, m2, p2x, p2y, MET_m, MET_x, MET_y):

    code = """
           mt2_bisect::mt2 mt2_event;;           

           double pa[3] = { m1, p1x, p1y };
           double pb[3] = { m2, p2x, p2y };
           double pmiss[3] = { 0, MET_x, MET_y };
           double mn    = MET_m;

           mt2_event.set_momenta(pa,pb,pmiss);
           mt2_event.set_mn(mn);
           //mt2_event.print();

           const double mt2 = mt2_event.get_mt2();
           // std::cout << endl << " mt2 = " << mt2 << std::endl;
           return_val = mt2;
           """

    # Pass all Python arguments to C++
    frame = inspect.currentframe()
    args = inspect.getargvalues(frame)[0]

    # print(args)

    lib_MT2 = inline(code,args,
                    headers=['"mt2_bisect.h"','"mt2_bisect_main.h"'],
                    include_dirs=["/scratch18/kazuki2/analyses/mT2_packages"],
                    verbose=0
                    )

    return lib_MT2
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号