Hi all,
I’m trying to read a ROOT file containing 2d vectors. By scavenging the forum I found that if I added the following it should work:
in *.py:
ROOT.gROOT.ProcessLine(’.L Loader.C+’)
in Loader.C:
#include
#pragma link C++ class vector<vector >+;
#pragma link C++ class vector<vector >+;
#pragma link C++ class vector<vector >+;
#pragma link C++ class vector<vector >+;
Locally
When I run the code on my mac (code attached) it now works, but not first, and its not clear to me what changed that…
LxPlus
Next I tried to run it on lxplus (SLC5, ROOT 5.26.00b) resulting in:
mjoergen@lxplus305 ~> python dedxplot.py user10.MortenDamJoergensen.user10.ChristianOhm.mc09_7TeV.106417.Pythia_R-Hadron0_gluino_450GeV.100404.15.6.3.12.reco.SYNTr98_CPH2010_SMP_filtered.15.6.8.4/user10.MortenDamJoergensen.user10.ChristianOhm.mc09_7TeV.106417.Pythia_R-Hadron0_gluino_450GeV.100404.15.6.3.12.reco.SYNTr98_CPH2010_SMP_filtered.15.6.8.4.AANT._00001.root
Traceback (most recent call last):
File “dedxplot.py”, line 47, in ?
main()
File “dedxplot.py”, line 4, in main
import ROOT
File “/afs/cern.ch/sw/lcg/app/releases/ROOT/5.26.00b/x86_64-slc5-gcc44-opt/root/lib/ROOT.py”, line 86, in ?
import libPyROOT as _root
ImportError: libpython2.5.so: cannot open shared object file: No such file or directory
Since that might be specific to lxplus, I tried another SLC5 machine we have at CERN:
Generic SLC5 + ATLAS 15.6.*
mjoergen@pcnbi2 Analysis> python dedxplot.py user10.MortenDamJoergensen.user10.ChristianOhm.mc09_7TeV.106417.Pythia_R-Hadron0_gluino_450GeV.100404.15.6.3.12.reco.SYNTr98_CPH2010_SMP_filtered.15.6.8.4.AANT._00001.root
Warning in TEnvRec::ChangeValue: duplicate entry <Library.vector=vector.dll> for level 0; ignored
Warning in TEnvRec::ChangeValue: duplicate entry <Library.vector=vector.dll> for level 0; ignored
Warning in TEnvRec::ChangeValue: duplicate entry <Library.vector=vector.dll> for level 0; ignored
Warning in TEnvRec::ChangeValue: duplicate entry <Library.vector=vector.dll> for level 0; ignored
Warning in TEnvRec::ChangeValue: duplicate entry <Library.vector=vector.dll> for level 0; ignored
Warning in TEnvRec::ChangeValue: duplicate entry <Library.vector=vector.dll> for level 0; ignored
Warning in TEnvRec::ChangeValue: duplicate entry <Library.vector=vector.dll> for level 0; ignored
Warning in TEnvRec::ChangeValue: duplicate entry <Library.vector=vector.dll> for level 0; ignored
Warning in TEnvRec::ChangeValue: duplicate entry <Library.vector=vector.dll> for level 0; ignored
Warning in TEnvRec::ChangeValue: duplicate entry <Library.vector=vector.dll> for level 0; ignored
TUnixSystem::SetDisplay:0: RuntimeWarning: DISPLAY not set, setting it to lxplus305.cern.ch:0.0
<class ‘ROOT.vector<vector >’>
add user10.MortenDamJoergensen.user10.ChristianOhm.mc09_7TeV.106417.Pythia_R-Hadron0_gluino_450GeV.100404.15.6.3.12.reco.SYNTr98_CPH2010_SMP_filtered.15.6.8.4.AANT._00001.root
TClass::TClass:0: RuntimeWarning: no dictionary for class AttributeListLayout is available
TClass::TClass:0: RuntimeWarning: no dictionary for class pair<string,string> is available
Traceback (most recent call last):
File “dedxplot.py”, line 45, in
main()
File “dedxplot.py”, line 29, in main
h2fDeDxTile.Fill(chain.Trk_p[trk]/1000, chain.Trk_dEdx[trk][8])
TypeError: ‘vector<vector >’ object is unindexable
My ultimate goal is the have it running in a grid job, a long way off it seems…
What am I doing wrong, and is there some other way to handle this in pure python?
Loader.C (212 Bytes)
dedxplot.py (1.37 KB)