sphericityFemto.C 2.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586
  1. #include <TFile.h>
  2. #include "TROOT.h"
  3. #include "TSystem.h"
  4. #include "TChain.h"
  5. #include "TTree.h"
  6. void sphericityFemto(const char *flist = "test.list",
  7. const char *ofile = "femtoQA_pp200_y2012.root")
  8. {
  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("StPicoDstMakerRun12");
  27. gSystem->Load("StFemtoDstMaker");
  28. gSystem->Load("StSphericity");
  29. StChain *chain = 0;
  30. StSphericity *maker = 0;
  31. //
  32. // List of member links in the chain
  33. //
  34. chain = new StChain("StChain");
  35. maker = new StSphericity("", flist, ".", 1e9);
  36. maker->SetOutFileName(ofile);
  37. maker->AddTrigId(370011); // vpdmb -nobsmd
  38. maker->AddTrigId(370001); // vpdmb
  39. maker->AddTrigId(370022); // bbcmb
  40. maker->AddTrigId(370501); // bht0 -vpdmb
  41. maker->AddTrigId(370511); // bht1 -vpdmb
  42. maker->AddTrigId(370531); // bht2
  43. maker->AddTrigId(370542); // bht0 -bbcmb -tof0
  44. maker->AddTrigId(370546); // bht1 -bbcmb -tof0
  45. maker->AddTrigId(370522); // bht2 -bbcmb
  46. maker->AddTrigId(370601); // jp0
  47. maker->AddTrigId(370611); // jp1
  48. maker->AddTrigId(370621); // jp2
  49. maker->AddTrigId(370641); // ajp
  50. maker->AddTrigId(370301); // bbcmb -tof0
  51. maker->AddTrigId(370361); // tofmult3 -vpd
  52. maker->AddTrigId(370341); // tofmult4
  53. maker->SetTrigger(370011, 1); // VPDMB triggers
  54. maker->SetTrigger(370001, 1);
  55. chain->Init();
  56. //
  57. // Loop over the links in the chain
  58. //
  59. int iret = 0;
  60. int nEvents = maker->GetNEvents();
  61. std::cout << "Entries in chain = " << nEvents << std::endl;
  62. for(int iev = 0; iev < nEvents; iev++) {
  63. chain->Clear();
  64. iret = chain->Make(iev);
  65. if(iret) {
  66. std::cout << "Error in Make occured. Error code: " << iret << std::endl;
  67. std::cout << "iev = " << iev << '\n';
  68. break;
  69. }
  70. }
  71. chain->Finish();
  72. //Cleanup
  73. delete maker;
  74. delete chain;
  75. }