cern root

histogram 绘图option

参考
使用TH1->Draw时,发现绘制的有errorbar,但是画不出连续的线,在option文档中提到当TH1有error时,默认绘制errorbar,需要使用HIST关闭这个默认行为。

h->Draw("same PL HIST")

redirection the root output in command line

.> aa.log
.x hello.C()
.>
  • 注意环境变量需要设置,每次运行前,可以编辑在~/.bashrc中

rootpy直接install

pip3 install rootpy

ROOT cannot be imported. Is ROOT installed with PyROOT enabled?

在python3中

import ROOT

Python 3.5 ImportError: dynamic module does not define module export function (PyInit_cv2) - Stack Overflow

python - rootpy installation probleme : Is ROOT installed with PyROOT enabled? - Stack Overflow

预编译root文件

ROOT macros and shared libraries - ROOT
下面代码会编译xxx.C为一个动态链接库xxx_C.so,其中包含xxx(int t)函数

root -l
.L xxx.C+

下面可以直接在命令行调用该函数,-e参数指定运行单引号内命令

root -l -e 'gSystem->Load("./xxx_C.so");xxx(2);'

Fit option

文档
默认使用chisquare计算,误差为bin内的值,为MLS(modified least-squares method)方法。

cppyy.LowLevelView

这种类型可以在python中索引,不能直接被numpy识别,无法利用numpy的一些特性比如切片和reshape,需要进行一次转换,比如对于这种类型的变量arr,大小是NDATA,python中类型一般是float64,当然需要对照自己当前的设置

arr.reshape((NDATA,))   # adjust the llv's size
v = np.frombuffer(arr, dtype=np.float64, count=NDATA)

评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

greatofdream

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值