FemtoDstQA.C 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. #include <TFile.h>
  2. #include "TROOT.h"
  3. #include "TSystem.h"
  4. #include "TChain.h"
  5. #include "TTree.h"
  6. //_____________________
  7. void FemtoDstQA(const char *flist = "sample.list",
  8. const char *ofile = "femtoQA.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("StPicoDstMakerRun11");
  27. gSystem->Load("StFemtoDstMaker");
  28. StChain *chain = 0;
  29. StFemtoDstQAMaker *maker = 0;
  30. //
  31. // List of member links in the chain
  32. //
  33. chain = new StChain("StChain");
  34. maker = new StFemtoDstQAMaker("", flist, ".", -1);
  35. maker->SetOutFileName(ofile);
  36. chain->Init();
  37. //
  38. // Loop over the links in the chain
  39. //
  40. int iret = 0;
  41. int nEvents = maker->GetNEvents();
  42. std::cout << "Entries in chain = " << nEvents << std::endl;
  43. for(int iev = 0; iev < nEvents; iev++) {
  44. chain->Clear();
  45. iret = chain->Make(iev);
  46. if(iret) {
  47. std::cout << "Error in Make occured. Error code: " << iret << std::endl;
  48. std::cout << "iev = " << iev << '\n';
  49. break;
  50. }
  51. }
  52. chain->Finish();
  53. //Cleanup
  54. delete maker;
  55. delete chain;
  56. }