FemtoDstQA_pp200_pythia8.C 2.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  1. #include <TFile.h>
  2. #include "TROOT.h"
  3. #include "TSystem.h"
  4. #include "TChain.h"
  5. #include "TTree.h"
  6. //_____________________
  7. void FemtoDstQA_pp200_pythia8(const char *flist = "test.list",
  8. const char *ofile = "femtoQA_pp200_pythia8.root")
  9. {
  10. std::cout << "Input file list = " << flist << '\n';
  11. if (!flist) {
  12. std::cout << "Input file list = NULL!\n";
  13. return;
  14. }
  15. //
  16. // Load libraries
  17. //
  18. gROOT->LoadMacro("$STAR/StRoot/StMuDSTMaker/COMMON/macros/loadSharedLibraries.C");
  19. loadSharedLibraries();
  20. gSystem->Load("libMinuit");
  21. gSystem->Load("StMuDSTMaker");
  22. gSystem->Load("StChain");
  23. gSystem->Load("StRefMultCorr");
  24. gSystem->Load("StFlowMaker");
  25. gSystem->Load("StFlowAnalysisMaker");
  26. gSystem->Load("StHbtMaker");
  27. gSystem->Load("StPicoDstMakerRun12");
  28. gSystem->Load("StarClassLibrary");
  29. gSystem->Load("libgsl");
  30. gSystem->Load("libgslcblas");
  31. gSystem->Load("libVMC.so");
  32. gSystem->Load("libStDb_Tables.so");
  33. gSystem->Load("libgen_Tables.so");
  34. gSystem->Load("libgeometry_Tables.so");
  35. gSystem->Load("libsim_Tables.so");
  36. gSystem->Load("libStarMagField.so");
  37. gSystem->Load("libSt_db_Maker.so");
  38. gSystem->Load("libSt_g2t.so");
  39. gSystem->Load("libSt_geant_Maker.so");
  40. gSystem->Load("StarGeneratorUtil.so");
  41. gSystem->Load("StarGeneratorEvent.so");
  42. gSystem->Load("StarGeneratorBase.so");
  43. gSystem->Load("StFemtoDstMakerSph");
  44. StChain *chain = 0;
  45. StFemtoDstQAMaker *maker = 0;
  46. //
  47. // List of member links in the chain
  48. //
  49. chain = new StChain("StChain");
  50. maker = new StFemtoDstQAMaker("", flist, ".", 1e9);
  51. maker->SetOutFileName(ofile);
  52. chain->Init();
  53. //
  54. // Loop over the links in the chain
  55. //
  56. int iret = 0;
  57. int nEvents = maker->GetNEvents();
  58. std::cout << "Entries in chain = " << nEvents << std::endl;
  59. for(int iev = 0; iev < nEvents; iev++) {
  60. chain->Clear();
  61. iret = chain->Make(iev);
  62. if(iret) {
  63. std::cout << "Error in Make occured. Error code: " << iret << std::endl;
  64. std::cout << "iev = " << iev << '\n';
  65. break;
  66. }
  67. }
  68. chain->Finish();
  69. //Cleanup
  70. delete maker;
  71. delete chain;
  72. }