pyroot

Python C API: omitted variable assignment causes unexpected behaviour

亡梦爱人 提交于 2020-06-25 10:49:32
问题 While using python with pyroot (a python interface to a CERN data analysis package named ROOT), I encountered the following strange behaviour: print ROOT.TFile(fname).GetListOfKeys() outputs None while the seemingly semantically equivalent code f=ROOT.TFile(fname) print f.GetListOfKeys() outputs the expected <ROOT.THashList object ("THashList") at 0x13f0fa0> . While this is hardly the first bug I have encountered while working with ROOT, this time I am quite puzzled that python allows this

Python C API: omitted variable assignment causes unexpected behaviour

穿精又带淫゛_ 提交于 2020-06-25 10:48:13
问题 While using python with pyroot (a python interface to a CERN data analysis package named ROOT), I encountered the following strange behaviour: print ROOT.TFile(fname).GetListOfKeys() outputs None while the seemingly semantically equivalent code f=ROOT.TFile(fname) print f.GetListOfKeys() outputs the expected <ROOT.THashList object ("THashList") at 0x13f0fa0> . While this is hardly the first bug I have encountered while working with ROOT, this time I am quite puzzled that python allows this

Python C API: omitted variable assignment causes unexpected behaviour

对着背影说爱祢 提交于 2020-06-25 10:48:07
问题 While using python with pyroot (a python interface to a CERN data analysis package named ROOT), I encountered the following strange behaviour: print ROOT.TFile(fname).GetListOfKeys() outputs None while the seemingly semantically equivalent code f=ROOT.TFile(fname) print f.GetListOfKeys() outputs the expected <ROOT.THashList object ("THashList") at 0x13f0fa0> . While this is hardly the first bug I have encountered while working with ROOT, this time I am quite puzzled that python allows this

Reading a TTree in root using PyRoot

扶醉桌前 提交于 2019-12-11 06:59:51
问题 I just started using pyroot to read root files and I can't read the data from a file using jupyter notebook. Here is how the TBrowser looks like: I started like this: import ROOT as root import numpy as np f = root.TFile("RealData.root") myTree = f.Get("tree") entries = myTree.GetEntriesFast() Up to here it is working and if I print entries I get the right number of entires I have in the file. But i don't know how to read actual data from the tree (event_number, n_channels, etc.) If I try

Enable PyROOT Ubuntu 14.04

天大地大妈咪最大 提交于 2019-12-06 15:44:57
问题 I downloaded madpgraph5 , but when I run it I get the following error: ERROR: ROOT file called 'ROOT.py' or 'ROOT.pyc' is not found ERROR: Please check that ROOT is properly installed. When I try locate ROOT.py and locate ROOT.pyc , I get nothing. I have root 5.34 installed and it runs smoothly. I also have python 2.7.6 installed. I downloaded rootpy , but have no idea how to include and enable PyROOT . I searched and I think I have to edit something to do with the path in bashrc , but before