FemtoDstQA_pp500_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_pp500_pythia8(const char *flist = "test.list",
  8. const char *ofile = "femtoQA_pp500_y2011.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("StarClassLibrary");
  28. gSystem->Load("libgsl");
  29. gSystem->Load("libgslcblas");
  30. gSystem->Load("libVMC.so");
  31. gSystem->Load("libStDb_Tables.so");
  32. gSystem->Load("libgen_Tables.so");
  33. gSystem->Load("libgeometry_Tables.so");
  34. gSystem->Load("libsim_Tables.so");
  35. gSystem->Load("libStarMagField.so");
  36. gSystem->Load("libSt_db_Maker.so");
  37. gSystem->Load("libSt_g2t.so");
  38. gSystem->Load("libSt_geant_Maker.so");
  39. gSystem->Load("StarGeneratorUtil.so");
  40. gSystem->Load("StarGeneratorEvent.so");
  41. gSystem->Load("StarGeneratorBase.so");
  42. gSystem->Load("StFemtoDstMakerSph");
  43. StChain *chain = 0;
  44. StFemtoDstQAMaker *maker = 0;
  45. //
  46. // List of member links in the chain
  47. //
  48. chain = new StChain("StChain");
  49. maker = new StFemtoDstQAMaker("", flist, ".", 1e9);
  50. maker->SetOutFileName(ofile);
  51. chain->Init();
  52. //
  53. // Loop over the links in the chain
  54. //
  55. int iret = 0;
  56. int nEvents = maker->GetNEvents();
  57. std::cout << "Entries in chain = " << nEvents << std::endl;
  58. for(int iev = 0; iev < nEvents; iev++) {
  59. chain->Clear();
  60. iret = chain->Make(iev);
  61. if(iret) {
  62. std::cout << "Error in Make occured. Error code: " << iret << std::endl;
  63. std::cout << "iev = " << iev << '\n';
  64. break;
  65. }
  66. }
  67. chain->Finish();
  68. //Cleanup
  69. delete maker;
  70. delete chain;
  71. }