Problem with vector<TLorentzVector>


I have a problem using a push_back method to add a TLorentzVector element to vector (see the attached code, gzipped). ROOT stack trace is attached as well.

PS. Ntuple is very big, so it is not attached, but I am hoping that the problem is “obvious” anyway.
PPS. I am using Fedora 4 with ROOT 5.14.

Thanks in advance for your help,
testdir.tar.gz (32.5 KB)

You should create a dictionary for vector.
You can do this easily by creating a small file (say dummy.C) below)

#include <vector> #include <TLorentzVector.h> #pragma link C++ class vector<TLorentzVector>;
then do

root > .L dummy.C+ root > .L t3333.C
I also suggest moving the creation of TLorentzVector objP4 ;
outside the main loop.


Thanks very much for your suggestion, Rene! Using the dictionary was what I needed.