Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include "TFile.h"
- #include "TTree.h"
- #include "TBranch.h"
- void jagged() {
- TFile *f;
- f = new TFile("jagged.root", "RECREATE");
- f->SetCompressionLevel(0);
- TTree *t = new TTree("sample", "");
- Int_t n = 1;
- t->Branch("n", &n, "n/I", 50);
- Int_t test[2];
- Int_t count = 1;
- t->Branch("test", test, "test[n]/I", 50);
- for (int i=0; i<2; i++) {
- for (int j=0; j<count; j++) {
- test[n] = 5 + count + j;
- }
- printf("n = %d\n", n);
- printf("count = %d\n", count);
- t->Fill();
- count = count + 1;
- }
- t->Write();
- f->Close();
- exit(0);
- }
Add Comment
Please, Sign In to add comment