Questions tagged [rootpy]

A feature-rich pythonic interface with the ROOT libraries on top of the PyROOT bindings.

The rootpy project is a community-driven initiative aiming to provide a more pythonic interface with ROOT on top of the existing PyROOT bindings.

12 questions
13
votes
1 answer

Unrecognized Command Line Option '-stdlib=libc++' with MacPorts gcc48

Context I'm trying to compile the package "root_numpy" which is a link between the scientific analysis software "root" and the python package "numpy". It's used as part of the root wrapper "rootpy". I get a g++ error when the following line is…
user3777020
  • 133
  • 1
  • 1
  • 4
4
votes
2 answers

Python array of strings in a ROOT TTree

I'm doing some work with CERN's pyROOT module, and I'm trying to store an array of strings as a leaf in a binary tree. In order to do so, I have to pass it an array, obviously, using not lists or dictionaries, but the array module. The module…
ecapstone
  • 269
  • 5
  • 14
4
votes
2 answers

Plotting of 2D histogram with rootpy and matplotlib

I am trying to plot a ROOT 2D histogram with rootpy and matplotlib. The code I use for this is: from rootpy.io import File from rootpy.plotting import Hist import rootpy.plotting.root2matplotlib as rplt import matplotlib.pyplot as plt inputFile =…
DragonTux
  • 732
  • 10
  • 22
2
votes
0 answers

How to convert a TChain to an array in root_numpy?

What is the best way to convert a TChain to an array in root_numpy? The function tree2array only works with trees, and it would be nice to not have to manually loop over every file and make a tree for each separate file. Thanks in advance!
2
votes
1 answer

Best way to store objects TFile via rootpy

I am trying to store a python class (or just the members) in a ROOT file (CERN, TFile) via rootpy. I can easily do this using a Tree and a TreeModel but that only works for basic types and does not result in the structure I am looking for. I had…
DragonTux
  • 732
  • 10
  • 22
1
vote
1 answer

Error installing rootpy: ROOT cannot be imported. Is ROOT installed with PyROOT enabled?

I am a 10.13.4 Mac user and I have ROOT 6.14.00 installed from running the dmg file downloaded from https://root.cern.ch/content/release-61400. I then tried to install rootpy by sudo pip install rootpy it gives me the error ROOT cannot be…
Joe Zhou
  • 11
  • 2
1
vote
0 answers

what version of GCC does pyTables 3.4.2 require

Background: I am trying to use pytables in conjunction with rootpy in order to convert ROOT files into hdf5 files. I am constrained to using gcc 4.4.7 and therefore cannot upgrade to ROOT6 if it requires a gcc upgrade. Problem: I have installed…
villaa
  • 1,043
  • 3
  • 14
  • 32
1
vote
1 answer

root2hdf5 traceback: tree2rec() got an unexpected keyword argument 'entries'

I installed rootpy and ensured that the requirements listed here for root2hdf5 were met. When trying to run root2hdf5 on a simple ROOT file generated with the following code: void tree1w() { // Create a Tree file tree1.root - create the file,…
jamesmorad
  • 11
  • 1
0
votes
1 answer

Converting ROOT Tree to HDF5

I have a TTree in ROOT with 1000 events and 15 variables associated to each of them. I would like to convert this in its entirety to an hdf5 dataset. How do I organise my data in HDF5 Groups such that I can access data both by event number and by…
Varun
  • 49
  • 8
0
votes
0 answers

ROOTpy plottin color not working in example directory

I have installed rootpy and matplotlib. But when I trying to run plot_matplotlib_hist.py in example directory, matplotlib canvas color was OK but the color of ROOT canvas only dark. It does not same color between matplotlib and ROOT.
Jay Ko
  • 1
0
votes
1 answer

ROOTpy plotting example not working

I'm trying to run the example on how to plot ROOT histograms via matplotlib from the rootpy documentation. This results in a rather vague error: import rootpy.plotting.root2matplotlib as rplt File "/Users/pigard/ROOT/install/lib/ROOT.py", line…
Philipp
  • 35
  • 3
-2
votes
1 answer

The histogram 'Clone' method in PyROOT/rootpy

I am doing some plotting of ROOT histograms using rootpy and have run in to a bit of a strange problem. I get a ROOT histogram using: Histo1 = FilePure.Get(HistoName + str("incl") + str(0)) Where Histoname is the name of the thing I need to. I…
JMzance
  • 1,704
  • 4
  • 30
  • 49