ROOT Analysis for the Inclusive Detachted Dilepton Trigger Lines
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

58 lines
1.4 KiB

  1. #include "TH1D.h"
  2. #include "TH2D.h"
  3. #include "THStack.h"
  4. #include "TGraph.h"
  5. #include "TTree.h"
  6. #include "TChain.h"
  7. #include "TFile.h"
  8. #include "TCanvas.h"
  9. #include "TROOT.h"
  10. #include "TStyle.h"
  11. #include "TColor.h"
  12. #include "TLorentzVector.h"
  13. #include "TRandom3.h"
  14. #include "TLorentzVector.h"
  15. #include "TMVA/Factory.h"
  16. #include "TMVA/DataLoader.h"
  17. #include <string>
  18. #include <iostream>
  19. #include <cmath>
  20. int inspect_tree() {
  21. auto file = TFile::Open("/auto/data/pfeiffer/inclusive_detached_dilepton/MC/BuToKpMuMu_rd_btoxll_simulation_12143001_MagDown_v0r0p6316987.root", "READ");
  22. auto tree = file->Get<TTree>("BuToKpMuMu23_noPID/DecayTree");
  23. auto branches = tree->GetListOfBranches();
  24. // /*Lesen*/
  25. // Double_t Bu_M;
  26. // tree->SetBranchAddress("Bu_M", &Bu_M);
  27. // for (size_t i = 0; i < tree->GetEntries(); i++)
  28. // {
  29. // tree->GetEntry(i);
  30. // // Bu_M verwenden
  31. // }
  32. // /*Schreiben*/
  33. // Double_t B_Theta, B_Blubb;
  34. // tree->Branch("B_Theta", &B_Theta, "B_Theta/D");
  35. // tree->Branch("B_Blubb", &B_Blubb, "B_Blubb/D");
  36. // for (size_t i = 0; i < 1000; i++)
  37. // {
  38. // B_Theta = 345435; // ....
  39. // B_Blubb = 348535435435579; // ....
  40. // tree->Fill();
  41. // }
  42. for (size_t i = 0; i < branches->GetSize(); i++)
  43. {
  44. TBranch* b = (TBranch*) branches->At(i);
  45. std::cout << b->GetName() << std::endl;
  46. }
  47. file->Close();
  48. return 0;
  49. }