实现了重离子碰撞背景减除的反应平面。
reaction-plane-fit的Python项目详细描述
反作用面拟合
实现Phys. Rev. C 93, 044915(或 arxiv)来描述并减去对 重离子碰撞中测量的相关函数。它可以适应背景主导的区域, 以及拟合rp包含信号支配区或rp依赖信号支配区的选择 地区。这个包实现了与RP相关的三个方向的拟合,并且有可能 直接扩展到其他方向集。
安装
这个包需要Python3.6及更高版本。有几个先决条件是必需的,但不幸的是不能
由于probfit
的打包详细信息,仅由PIP解决。
$ pip install numpy cython
该软件包在PyPI上提供,可通过pip获得。
$ pip install reaction_plane_fit
您可能需要考虑将其安装到您的用户目录(--user
)或更好的方式,在虚拟机中
环境。
用法
对这个包执行fit只需要几行代码。以下内容足以定义和运行 适用于一些示例值:
fromreaction_plane_fitimportthree_orientations# Define the fit object.rp_fit=three_orientations.BackgroundFit(resolution_parameters={"R22":0.6,"R42":0.3,"R62":0.1,"R82":0.1},use_log_likelihood=False,signal_region=(0,0.6),background_region=(0.8,1.2),)# Load or otherwise provide the relevant histograms here.# The structure of this dictionary is important to ensure that the proper data ends up in the right place.# Note that the data must already be projected into the background or signal dominated regions.data={"background":{"in_plane":ROOT.TH1..,"mid_plane":ROOT.TH1...,"out_of_plane":ROOT.TH1...}}# Perform the actual fit.success,_=rp_fit.fit(data=data)# Print the fit resultsprint("Fit result: {fit_result}".format(fit_result=rp_fit.fit_result))
沿背景拟合包含的反作用平面方向信号或拟合示例
只有背景在reaction_plane_fit.example
中都可用。此模块也可以直接运行
在终端中,通过:
$ python -m reaction_plane_fit.example [-b] [-i dataFilename]
如果没有指定fit数据,它将使用一些示例数据。更多信息,包括所有可能的 适合函数组合,请参见full documentation。
但我不喜欢Python!
使用python可能不太高兴。没关系-我们可以用根来解决这个问题,尽管 比直接使用python要痛苦得多。为此,它应该看起来像(下面的代码 是未测试的,因此可能需要一些小的修改:
// Setup the input data.std::map<std::string,std::map<std::string,TH1*>>inputData;inputData["background"]["in_plane"]=my_in_plane_hist;// Fill in the rest of your input data....// Setup the fit objects.TPython::Exec("from reaction_plane_fit import three_orientations");TPython::Exec("rp_fit = three_orientations.BackgroundFit(""resolution_parameters = {'R22': 0.6, 'R42': 0.3, 'R62': 0.1, 'R82': 0.1},""use_log_likelihood = False,""signal_region = (0, 0.6),""background_region = (0.8, 1.2),)");// Perform the actual fit.TPython::Exec("success, _ = rp_fit.fit(data = data)");// Print the fit results.TPython::Exec("print('Fit result: {fit_result}'.format(fit_result = rp_fit.fit_result))")// Access values back in c++.intchi_2=double(TPython::Eval("rp_fit.fit_result.minimum_val"))// It will require some attention to extract all of the relevant values.// You can extract a number of types (see TPyResult), but it doens't appear that you can extract complex objects.// So this could still be a somewhat painful process.
(别忘了我们在下面打电话给Minuit,所以这个包的速度应该足够适合这种情况)。
安装已实现
有三种可能的配合类型:
- 仅限背景主导区域:这仅适用于大DETA近侧的主导区域
根据背景资料。在每一组定向实现中调用
BackgroundFit
。 - 包含信号区域:这适用于RP包含信号控制区域,也适用于RP
依赖背景主导区域。在每一组定向实现中调用
InclusiveSignalFit
。 - 依赖于RP的信号区域:这适合于依赖于RP的信号支配区域,也适合于依赖于RP的信号支配区域
依赖背景主导区域。在每一组定向实现中调用
SignalFit
。
三个方向(平面内、平面中和平面外)
此包实现了相对于反应平面的三个方向的拟合:
- 平面内(0<;Δφ<;π/6)
- 中面(π/6<;Δφ<;π/3)
- 平面外(π/3<;Δφ<;π/2)
这些fit在reaction_plane_fit.three_orientations
模块中实现。
安装注意事项
这个包使使用minos而不是hesse错误成为可能。当 黑塞误差变得不精确(当极小值附近的函数不近似为超抛物线)时, 但是它们可能需要更长的时间来计算,并且不能通过协方差矩阵来描述(这会产生误差 传播更加困难)。如果hesse和minos的错误是相似的,那么函数是好的 用超抛物线近似,可以安全地使用黑塞错误。有关更多信息,请参阅iminuit教程。
开发
如果正在开发打包,请克隆存储库,然后使用
$ pip install -e .[dev,tests]
注意,Python3.6及更高版本是必需的,因为这个包使用dataclasses
(它有一个Python3.6
它依赖于正在订购的字典(它是对于cpython
3.6为true,对于
python 3.7)。
引文
请引用论文(phys.修订版c 93 044915),以及此实现:
@misc{raymond_ehlers_2018_1599239,
author = {Raymond Ehlers},
title = {reactionPlaneFit - RPF implementation},
month = nov,
year = 2018,
doi = {10.5281/zenodo.1599239},
url = {https://doi.org/10.5281/zenodo.1599239}
}
致谢
代码从M. Arratia完成的实现工作开始。 感谢C.Nattrass和J.Mazer的帮助和讨论。