convertQGSM.C 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  1. #include "TROOT.h"
  2. #include "TSystem.h"
  3. #include "TChain.h"
  4. #include "TFile.h"
  5. #include "TString.h"
  6. #include <iostream>
  7. const Char_t* defaultInFile = "test.list";
  8. const Char_t *defaultOutFile = "test"; // extension will be assigned automatically
  9. using namespace std;
  10. class StQGSMdstMaker;
  11. StQGSMdstMaker *maker = NULL;
  12. void convertQGSM(const Char_t* inFileList = defaultInFile,
  13. const Char_t* outFileName = defaultOutFile)
  14. {
  15. //Load libraries
  16. cout << "Loading libraries..." << endl;
  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("StFemtoDstMaker");
  43. gSystem->Load("StQGSM");
  44. cout << "Libraries have been successfully loaded" << endl;
  45. //
  46. // Create chain
  47. //
  48. StChain *mChain = new StChain("StChain");
  49. maker = new StQGSMdstMaker(inFileList, outFileName);
  50. //и
  51. // Chain initialization and loop over events
  52. //
  53. mChain->Init();
  54. Int_t iReturn = 0;
  55. Int_t mNEventsProcessed = 0;
  56. while (1)
  57. {
  58. mChain->Clear();
  59. iReturn = mChain->Make();
  60. if (maker->IsStop()) break;
  61. }
  62. mChain->Finish();
  63. delete mChain;
  64. }