Reikriam

Untitled

Apr 18th, 2020
124
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.64 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 = 1;
  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. for (int j=0; j<count; j++) {
  17. test[n] = 5 + count + j;
  18. }
  19. printf("n = %d\n", n);
  20. printf("count = %d\n", count);
  21. t->Fill();
  22. count = count + 1;
  23. }
  24. t->Write();
  25. f->Close();
  26. exit(0);
  27. }
Add Comment
Please, Sign In to add comment