data analysis scripts
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.

46 lines
964 B

  1. #include <string.h>
  2. #include <stdio.h>
  3. #include <iostream>
  4. #include <vector>
  5. #include <utility>
  6. #include <TFile.h>
  7. #include <TTree.h>
  8. #include <TSystemDirectory.h>
  9. #include "beammon.h"
  10. using namespace std;
  11. int main(int argc, char **argv)
  12. {
  13. const char *dirname = "/mnt/g/HIT/time_aligned/20170508/pin/";
  14. const char *ext = ".root";
  15. gROOT->ProcessLine(".x lhcbStyle.C");
  16. TSystemDirectory dir(dirname, dirname);
  17. TList *files = dir.GetListOfFiles();
  18. if (files)
  19. {
  20. TSystemFile *file;
  21. TString fname;
  22. TIter next(files);
  23. while ((file = (TSystemFile *)next()))
  24. {
  25. fname = file->GetName();
  26. if (!file->IsDirectory() && fname.EndsWith(ext) && !fname.BeginsWith("SAVE"))
  27. {
  28. Beammon *mon = new Beammon();
  29. printf("File name: %s \n", fname.Data());
  30. mon->Initialize(dirname, fname.Data(), 10000, 10000, 1., true, 1000., 100.);
  31. mon->Save();
  32. delete mon;
  33. }
  34. }
  35. }
  36. return 0;
  37. }