This is my first time posting so apologies if I have placed this in the wrong section.
Setup: I am running PYTHIA stand-alone (HEp event generator). To drive the PYTHIA software, I have a c++ executable. Inside the c++ executable, I try to load root, generate a root ntuple with the data from PYTHIA, and then save the root ntuple.
The problem: The output root file exists. It has the correct naming conventions. But it has no trees and no data.
Attaching file test.root as _file0…
root  _file0->ls()
KEY: TTree Default;1
root  Default->Print()
OBJ: TStyle Default Default Style
//Completely empty, if you open in TBrowser there are no trees displayed.
The code: Since this exists inside a larger c++ executable, I’m not sure that you would want to see all the code. I have extracted all the relevant root commands below:
Two quick notes - The output statements shows that I am pushing back numbers into the vector that make sense. And, the TTree-Print() command that I issue near the end of .exe also shows an empty tree…strange?
Thanks very much,
string nametemp = “test.root”;
TFile* file = TFile::Open(nametemp.c_str(),“RECREATE”);
TTree* TreeD = new TTree(“Default”,"");
_mc_px = new vector();
//these lines (below) inside event loop
cout << endl << "TESTING push back "<< px << endl;
//lines (above) inside event loop
//The tree is empty at this print!