FemtoDstQAIncSel.C 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. #include <TFile.h>
  2. #include "TROOT.h"
  3. #include "TSystem.h"
  4. #include "TChain.h"
  5. #include "TTree.h"
  6. //_____________________
  7. void FemtoDstQAIncSel(const char *flist = "oFemtoDstInclusiveSelectorTest.root",
  8. const char *ofile = "oFemtoQA.root") {
  9. std::cout << "Input file list = " << flist << '\n';
  10. if (!flist) {
  11. std::cout << "Input file list = NULL!\n";
  12. return;
  13. }
  14. //
  15. // Load libraries
  16. //
  17. gROOT->LoadMacro("$STAR/StRoot/StMuDSTMaker/COMMON/macros/loadSharedLibraries.C");
  18. loadSharedLibraries();
  19. gSystem->Load("libMinuit");
  20. gSystem->Load("StMuDSTMaker");
  21. gSystem->Load("StChain");
  22. gSystem->Load("StRefMultCorr");
  23. gSystem->Load("StFlowMaker");
  24. gSystem->Load("StFlowAnalysisMaker");
  25. gSystem->Load("StHbtMaker");
  26. gSystem->Load("StFemtoDstMaker");
  27. StChain *chain = 0;
  28. StFemtoDstQAMaker *maker = 0;
  29. //
  30. // List of member links in the chain
  31. //
  32. chain = new StChain("StChain");
  33. maker = new StFemtoDstQAMaker("", flist);
  34. maker->SetOutFileName(ofile);
  35. chain->Init();
  36. //
  37. // Loop over the links in the chain
  38. //
  39. int iret = 0;
  40. int nEvents = maker->GetNEvents();
  41. std::cout << "Entries in chain = " << nEvents << std::endl;
  42. for(int iev = 0; iev < nEvents; iev++) {
  43. chain->Clear();
  44. iret = chain->Make(iev);
  45. if(iret) {
  46. std::cout << "Error in Make occured. Error code: " << iret << std::endl;
  47. std::cout << "iev = " << iev << '\n';
  48. break;
  49. }
  50. }
  51. chain->Finish();
  52. //Cleanup
  53. delete maker;
  54. delete chain;
  55. }