ROOT  6.07/01
Reference Guide
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
circular.C File Reference

Example of a circular Tree. More...

Go to the source code of this file.

Detailed Description

Example of a circular Tree.

Circular Trees are interesting in online real time environments to store the results of the last maxEntries events. for more info, see TTree::SetCircular. Circular trees must be memory resident.

void circular() {
auto T = new TTree("T","test circular buffers");
T->Branch("px",&px,"px/F");
T->Branch("py",&py,"px/F");
T->Branch("pz",&pz,"px/F");
T->Branch("random",&random,"random/D");
T->Branch("i",&i,"i/s");
T->SetCircular(20000); //keep a maximum of 20000 entries in memory
for (i = 0; i < 65000; i++) {
r.Rannor(px,py);
pz = px*px + py*py;
random = r.Rndm();
T->Fill();
}
T->Print();
}
Author
Rene Brun

Definition in file circular.C.