Problem with vector<TLorentzVector>

Hello,

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,
Daniel
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.

Rene

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

Daniel