Questions tagged [pyroot]

`PyROOT` is a Python extension module that allows the user to interact with any `ROOT` class from the Python interpreter.

PyROOT is a Python extension module that allows the user to interact with any ROOT class from the Python interpreter. This is done generically using the ROOT dictionary, therefore there is no need to generate any Python wrapper code to include new ROOT classes. At the same time PyROOT offers the possibility to execute and evaluate any Python command or start a Python shell from the ROOT/CINT prompt. Further details are available in the PyROOT manual.

See more:

56 questions
0
votes
0 answers

Error reading histogram from root file

I am reading a root file whose structure looks like: $ root -l Residual_Position_iter_99_R1869.root .lroot [0] Attaching file Residual_Position_iter_99_R1869.root as _file0... s Warning in : no dictionary for class TF1Parameters is…
ramkrishna
  • 632
  • 1
  • 7
  • 24
0
votes
3 answers

How can I perform `import *` from within a function?

I have the following standard import procedure: from ROOT import * Because of the way ROOT handles command line options and arguments, something like the following is required in order to avoid screwing up the script's command line…
d3pd
  • 7,935
  • 24
  • 76
  • 127
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
0
votes
1 answer

Pycharm 4 no module named ROOT, when importing a locally installed module (PyROOT), that is working fine from shell on Mac OS X Yosemite

I am trying to set up PyROOT to work with Pycharm 4 on Mac OS X Yosemite. I have installed ROOT (locally), with the python option enabled, and set up all of the necessary environment paths. echo…
Natalia Zoń
  • 980
  • 2
  • 12
  • 22
0
votes
2 answers

Enable PyROOT Ubuntu 14.04

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.…
Jorge
  • 1
  • 1
  • 1
0
votes
1 answer

Py.Test aborts when (py)ROOT is imported

I've a problem unit testing Python code, which uses the (py)ROOT package. It simply aborts collecting the tests when there is a line import ROOT in one of the scripts. Does anybody have an idea what's going on? foo@bar ~/project/dir …
tamasgal
  • 24,826
  • 18
  • 96
  • 135
0
votes
1 answer

How to pickle classes which inherit from TLorentzVector?

This uses PyROOT (ROOT) and pickling. A very simple example below. I tried to use How to pickle an object of a class B (having many variables) that inherits from A, that defines __setstate__ and __getstate__ as an example. from ROOT import…
kratsg
  • 600
  • 1
  • 5
  • 17
0
votes
1 answer

Using pyROOT in pycharm

I would like to use a pyROOT module in my software under the pycharm IDE. My problem is that the IDE doesn't recognize any of root modules. Can you tell me what should I do to fix this issue?
user1877600
  • 627
  • 1
  • 9
  • 26
-1
votes
1 answer

How to fill the branches of a tree?

import sys import ROOT from progressbar import Bar, Percentage, ProgressBar from time import time from tools import duration, check_outfile_path ECMS = 3.686 p4shw = ROOT.vector('double')() def main (): args = sys.argv[1:] if…
-2
votes
1 answer

Calling multiple functions from within function

I am trying to call a function from within a function, and the former calls more functions etc. import ROOT as root import sys, math class SFs(): def __init__(self): self.get_EfficiencyData = None self.get_EfficiencyMC = None …
Terma
  • 81
  • 8
-2
votes
1 answer

Python function replacing part of variable

I am writing a code for a project in particle physics (using pyroot). In my first draft, I use the following line for i in MyTree: pion.SetXYZM(K_plus_PX, K_plus_PY, K_plus_PZ,K_plus_MM) This basically assigns to the pion the values of…
Blaise Delaney
  • 321
  • 1
  • 6
  • 15
1 2 3
4