Reikriam

Untitled

Apr 18th, 2020
149
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.66 KB | None | 0 0
  1. #include "TFile.h"
  2. #include "TTree.h"
  3. #include "TBranch.h"
  4.  
  5. void jagged() {
  6. TFile *f;
  7. f = new TFile("jagged.root", "RECREATE");
  8. f->SetCompressionLevel(0);
  9. TTree *t = new TTree("sample", "");
  10. Int_t n;
  11. t->Branch("n", &n, "n/I", 50);
  12. Int_t test[2];
  13. Int_t count = 1;
  14. t->Branch("test", test, "test[n]/I", 50);
  15. for (int i=0; i<2; i++) {
  16. n = count;
  17. for (int j=0; j<count; j++) {
  18. test[n] = 5 + count + j;
  19. }
  20. printf("n = %d\n", n);
  21. printf("count = %d\n", count);
  22. t->Fill();
  23. count = count + 1;
  24. }
  25. t->Write();
  26. f->Close();
  27. //exit(0);
  28. }
Add Comment
Please, Sign In to add comment