O97DstQA.C 1.5 KB

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