Dear all,
I have some issues with the following sample code, inside the interpreter works fine and also I am able to compile it, but when I run, it crashes at the lines where I try to set “track->fV.fX = …” Do you have any idea about the reason why?
thanks!
TEveRecTrack* track;
TFile* ed_file;
TTree* event_display_tree;
ed_file = new TFile("/home/user/trial.root", "RECREATE");
TDirectoryFile *hpx = new TDirectoryFile("Event0001","");
ed_file->cd("Event0001");
event_display_tree = new TTree("RecTracks","Reconstructed tracks");
event_display_tree->Branch("R", "TEveRecTrack", &track, 16000, 2);
track->fV.fX = 5;
track->fV.fY = 4;
track->fV.fZ = 3;
track->fP.fX = 0.1;
track->fP.fY = 0.1;
track->fP.fZ = 1;
//track->fIndex = -1;
event_display_tree->Write();
event_display_tree->Fill();