I would like to store in some output tree a ROOT.std.vector(ROOT.TLorentzVector())() .
If I store a branch with ROOT.TLorentzVector, it works.
If I store a branch with ROOT.std.vector(float)(), it works.
But if I combine both, it fails probably due to missing dictionnary.
Do you know what code I should add to make it work with pyroot ?
Write a file loader.C// Loader.C
#include "TLorentzVector.h"
#include <vector>
#ifdef __MAKECINT__
#pragma link C++ class vector<TLorentzVector>+;
#endifand use with:gROOT.ProcessLine(".L loader.C+")
same thing: a dictionary needs to be generated for the vector of vector of ints. In some experiments (e.g. ATLAS), there are standard libs that already contain (Reflex) dictionaries of such containers. Otherwise, follow the same recipe as for the vector of TLorentzVector.
I followed your instructions above but I get the following error:
Info in <TUnixSystem::ACLiC>: creating shared library /home/vm1023/ZeroLeptonTestArea/./loadVector_C.so
Traceback (most recent call last):
File "./createNewTrees.py", line 56, in <module>
jetInfo = ROOT.std.vector(ROOT.TLorentzVector())
File "/cvmfs/atlas.cern.ch/repo/ATLASLocalRootBase/x86_64/root/6.04.14-x86_64-slc6-gcc49-opt/lib/cppyy.py", line 90, in __call__
result = _backend.MakeRootTemplateClass( *newargs )
SystemError: error return without exception set
as you can see, I’m using ROOT6
Any help is highly appreciated.
that’s a clearly a bug. Recommend filing one on Jira. (ATLAS pulled me off PyROOT some time ago, so I’m no longer maintaining it, but the ROOT team still is.)