FemtoDstQA_pp510_y2011.C 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104
  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("StRefMultCorr");
  21. gSystem->Load("StFlowMaker"); // should be placed before HBT
  22. gSystem->Load("StHbtMaker");
  23. gSystem->Load("StarClassLibrary");
  24. gSystem->Load("libgsl");
  25. gSystem->Load("libgslcblas");
  26. gSystem->Load("StPicoDstMakerRun12");
  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, ".", -1);
  50. maker->SetOutFileName(ofile);
  51. maker->AddTrigId(320000); //Trigger selection for pp500 y2011
  52. maker->AddTrigId(320001);
  53. maker->AddTrigId(320011);
  54. maker->AddTrigId(320021);
  55. maker->AddTrigId(330021);
  56. maker->AddTrigId(320103); // NOT VPDMB here and below
  57. maker->AddTrigId(320113);
  58. maker->AddTrigId(320123);
  59. maker->AddTrigId(330123);
  60. maker->AddTrigId(320500);
  61. maker->AddTrigId(320504);
  62. maker->AddTrigId(320514);
  63. maker->AddTrigId(320524);
  64. maker->AddTrigId(330524);
  65. maker->AddTrigId(320501);
  66. maker->AddTrigId(330501);
  67. maker->AddTrigId(320503);
  68. maker->AddTrigId(330503);
  69. maker->SetTrigger(320000, 1); // set only VPDMB triggers
  70. maker->SetTrigger(320001, 1);
  71. maker->SetTrigger(320011, 1);
  72. maker->SetTrigger(320021, 1);
  73. maker->SetTrigger(330021, 1);
  74. chain->Init();
  75. //
  76. // Loop over the links in the chain
  77. //
  78. int iret = 0;
  79. int nEvents = maker->GetNEvents();
  80. std::cout << "Entries in chain = " << nEvents << std::endl;
  81. for(int iev = 0; iev < nEvents; iev++) {
  82. chain->Clear();
  83. iret = chain->Make(iev);
  84. if(iret) {
  85. std::cout << "Error in Make occured. Error code: " << iret << std::endl;
  86. std::cout << "iev = " << iev << '\n';
  87. break;
  88. }
  89. }
  90. chain->Finish();
  91. //Cleanup
  92. delete maker;
  93. delete chain;
  94. }