FemtoDstQA.C 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103
  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. //
  52. // Trigger for pp200 y2012
  53. //
  54. femtoReader->AddTrigId(370011); // vpdmb-nobsmd
  55. femtoReader->AddTrigId(370001); // vpdmb
  56. femtoReader->AddTrigId(370022); // bbcmb
  57. femtoReader->AddTrigId(370501); // bht0-vpdmb
  58. femtoReader->AddTrigId(370511); // bht1-vpdmb
  59. femtoReader->AddTrigId(370531); // bht2
  60. femtoReader->AddTrigId(370542); // bht0-bbcmb-tof0
  61. femtoReader->AddTrigId(370546); // bht1-bbcmb-tof0
  62. femtoReader->AddTrigId(370522); // bht2-bbcmb
  63. femtoReader->AddTrigId(370601); // jp0
  64. femtoReader->AddTrigId(370611); // jp1
  65. femtoReader->AddTrigId(370621); // jp2
  66. femtoReader->AddTrigId(370641); // ajp
  67. femtoReader->AddTrigId(370301); // bbcmb-tof0
  68. femtoReader->AddTrigId(370361); // tofmult3-vpd
  69. femtoReader->AddTrigId(370341); // tofmult4
  70. //
  71. // Turn on only min-bias triggers
  72. //
  73. femtoReader->SetTrigger(370011, 1);
  74. femtoReader->SetTrigger(370001, 1);
  75. chain->Init();
  76. //
  77. // Loop over the links in the chain
  78. //
  79. int iret = 0;
  80. int nEvents = maker->GetNEvents();
  81. std::cout << "Entries in chain = " << nEvents << std::endl;
  82. for(int iev = 0; iev < nEvents; iev++) {
  83. chain->Clear();
  84. iret = chain->Make(iev);
  85. if(iret) {
  86. std::cout << "Error in Make occured. Error code: " << iret << std::endl;
  87. std::cout << "iev = " << iev << '\n';
  88. break;
  89. }
  90. }
  91. chain->Finish();
  92. //Cleanup
  93. delete maker;
  94. delete chain;
  95. }