Dear ROOT experts,
I have got a problem while using TVectors of floats.
I’d like to save a TVectorF (with non define size) in a tree named tree but my method doesn’t work:
TFile *hfile = new TFile("event.root","RECREATE");
TTree *tree = new TTree("DAQ16/03/09", "DATA_capteurs");
TVectorF vect_pos;
tree->Branch("vect_pos", "TVector" ,&vect_pos);
while (!feof(Dgain))
{
//Get Size --> nbcan
........
vect_pos.Clear();
vect_pos.ResizeTo(nb_can);
//Fill The TVector
.......
tree->Fill();
}
tree->Write();
hfile->Close();
If it is possible, please also teach me how to save my TVector preperly.
thanks
TFile *hfile = new TFile(event.root,"RECREATE");
TTree *tree = new TTree("daqroot", "DATA_capteurs");
TVectorF *vect_pos = new TVectorF(0);
tree->Branch("vect_pos",&vect_pos,32000,0);
/*_______A PROPOS DES TVectors__________________
//http://root.cern.ch/root/html400/TVectorF.html
TVectorF *test = new TVectorF(X);
test->Clear; //effacer
test->ResizeTo(); //redim
test->GetNoElements();//nombre d'element
test->GetLwb();//borne min
test->GetUpb();//borne max
(*test)(i) = X; //remplire au rang i avec X
test->Print(); //montrer le vecteur
*/
tree->Fill();
tree->Write();
hfile->Close();