vector<TLorentzVector> segmentation error


The code attached (WriteNtuple.C) tries to write an ntuple from a text fie (nn.txt). The problem is if I uncomment the line which does vector::push_back(TLorentzVector), it generates segmentation fault. Any suggestion on how to fix this will be appreciated. I’m using root v3.05/07 but 4.00.08 fails too.

Thanks very much.
example.tar.gz (7.21 KB)


This seems to be a CINT problem when calling push_back. I have reported it to Masa. If you execute with ACLIC, your program will run correctly
root > .x WriteNtuple.C+

The problem is not related to I/O and Trees.


ps: add #include

Thanks, Rene. Your suggestion works very well.