Best regards
Leszek
We inlcude a simple macro with the definition of this TTree.
{
TFile *f = new TFile("test.root", "RECREATE");
TClonesArray *atab = new TClonesArray("AAA", 16);
TClonesArray *btab = new TClonesArray("BBB", 16);
TTree *tree = new TTree("T", "test");
tree->Branch("AAA", &atab, 64000, 1);
tree->Branch("BBB", &btab, 64000, 1);
new((*atab)[0]) AAA(5, 6);
new((*atab)[1]) AAA(4, 5);
new((*atab)[2]) AAA(3, 4);
new((*btab)[0]) BBB(7, 4);
new((*btab)[1]) BBB(6, 3);
tree->Fill();
f->Write();
f->Close();
delete f;
}
Class definition:
#include <TObject.h>
#include <TClonesArray.h>
class AAA : public TObject
{
public:
AAA(){A1 = 0; A2 = 0;}
AAA(int a1, int a2){A1 = a1; A2 = a2;}
int A1;
int A2;
ClassDef(AAA, 1)
};
class BBB : public TObject {
public:
BBB(){B1 = 0; B2 = 0;}
BBB(int b1, int b2){B1 = b1; B2 = b2;}
int B1;
int B2;
ClassDef(BBB, 1)
};