reco_with_zdc.C 6.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174
  1. // Macro for running reconstruction
  2. #if !defined(__CINT__) || defined(__MAKECINT__)
  3. // ROOT includes
  4. #include "TString.h"
  5. #include "TStopwatch.h"
  6. #include "TSystem.h"
  7. // Fair includes
  8. #include "FairRunAna.h"
  9. #include "FairRuntimeDb.h"
  10. #include "FairParRootFileIo.h"
  11. #include "FairTask.h"
  12. #include "FairField.h"
  13. #include "FairTrackParP.h"
  14. // MPD includes
  15. #include "TpcClusterizerTask.h"
  16. #include "TpcDriftTask.h"
  17. #include "TpcHitFinderTask.h"
  18. #include "MpdKalmanFilter.h"
  19. #include "TpcLheHitsMaker.h"
  20. #include "MpdTpcKalmanFilter.h"
  21. #include "MpdTofHitProducer.h"
  22. #include "MpdTofMatching.h"
  23. #include <iostream>
  24. using namespace std;
  25. #endif
  26. //void reco_with_zdc (TString inFile = "zdctest.root", Int_t number_of_events=0)
  27. //void reco_with_zdc (TString inFile = "/hera/cbm/users/marina/laqgsm/AuAuss11mb/output_1/job_0000/evetest.root", Int_t number_of_events=0)
  28. //void reco_with_zdc (TString inFile = "evetest_mup_158GeV_mod13_1000ev_oldgeom84mods_oldProcHits.root", Int_t number_of_events=0)
  29. //void reco_with_zdc (TString inFile = "evetest_mup_158GeV_mod24_1000ev_newgeom_oldProcHits.root", Int_t number_of_events=0)
  30. //void reco_with_zdc (TString inFile = "evetest_p_40GeV_mod25_1000ev_newProcHits_FscScint.root", Int_t number_of_events=0)
  31. //void reco_with_zdc (TString inFile = "evetest_2ev_onlyPSD.root", Int_t number_of_events=0)
  32. void reco_with_zdc (TString inFile = "evetest_10ev_new.root", Int_t number_of_events=0)
  33. //void reco_with_zdc (TString inFile = "evetest_40ev_node207.root", Int_t number_of_events=0)
  34. {
  35. // ========================================================================
  36. // Verbosity level (0=quiet, 1=event level, 2=track level, 3=debug)
  37. Int_t iVerbose = 1;
  38. // Input file (MC events)
  39. //TString inFile = "mc.root";
  40. // Parameter file
  41. //TString parFile = "testparams.root";
  42. TString parFile = inFile;
  43. // Output file
  44. /*
  45. if (number_of_events)
  46. TString outFile = Form("mpddst_%devents_%s",number_of_events,inFile.Data());
  47. else
  48. TString outFile = Form("mpddst_%s",inFile.Data());
  49. */
  50. TString outFile = Form("mpddst.root");
  51. // // ---- Load libraries -------------------------------------------------
  52. gROOT->LoadMacro("$VMCWORKDIR/macro/mpd/mpdloadlibs.C");
  53. // mpdloadlibs(kTRUE); // load full set of main libraries
  54. mpdloadlibs(1,1); // load full set of libraries
  55. //gSystem->Load("libMpdData");
  56. gSystem->Load("libXMLIO");
  57. // gROOT->LoadMacro("$VMCWORKDIR/macro/mpd/geometry_v1.C");
  58. // geometry_v1(0x0, kFALSE);
  59. // ------------------------------------------------------------------------
  60. // --- Now choose concrete engines for the different tasks -------------
  61. // ------------------------------------------------------------------------
  62. // In general, the following parts need not be touched
  63. // ========================================================================
  64. // ----- Timer --------------------------------------------------------
  65. TStopwatch timer;
  66. timer.Start();
  67. // ------------------------------------------------------------------------
  68. // ----- Digitization run -------------------------------------------
  69. FairRunAna *fRun= new FairRunAna();
  70. fRun->SetInputFile(inFile);
  71. //fRun->AddFriend(inFile);
  72. fRun->SetOutputFile(outFile);
  73. // ------------------------------------------------------------------------
  74. // ----- Parameter database --------------------------------------------
  75. FairRuntimeDb* rtdb = fRun->GetRuntimeDb();
  76. FairParRootFileIo* parInput1 = new FairParRootFileIo();
  77. parInput1->open(parFile.Data());
  78. //FairParAsciiFileIo* parInput2 = new FairParAsciiFileIo();
  79. //TString stsDigiFile = gSystem->Getenv("VMCWORKDIR");
  80. //stsDigiFile += "/parameters/sts/sts_digi_new_standard.par";
  81. //parInput2->open(stsDigiFile.Data(),"in");
  82. rtdb->setFirstInput(parInput1);
  83. //rtdb->setSecondInput(parInput2);
  84. // fRun->LoadGeometry(); // EL
  85. // ------------------------------------------------------------------------
  86. // TpcClusterizerTask* tpcClusterizer = new TpcClusterizerTask();
  87. // fRun->AddTask(tpcClusterizer);
  88. // TpcDriftTask* tpcDrifter = new TpcDriftTask();
  89. // fRun->AddTask(tpcDrifter);
  90. // TpcHitFinderTask* tphHitFinderTask = new TpcHitFinderTask();
  91. // fRun->AddTask(tphHitFinderTask);
  92. MpdKalmanFilter *kalman = MpdKalmanFilter::Instance("KF");
  93. //fRun->AddTask(kalman);
  94. MpdTpcHitProducer* hitPr = new MpdTpcHitProducer();
  95. //hitPr->SetModular(0);
  96. //fRun->AddTask(hitPr);
  97. // FairTask* trackMS = new TpcLheHitsMaker("Hit producer");
  98. // fRun->AddTask(trackMS);
  99. FairTask* vertZ = new MpdVertexZfinder();
  100. //fRun->AddTask(vertZ);
  101. FairTask* recoKF = new MpdTpcKalmanFilter("Kalman filter");
  102. //fRun->AddTask(recoKF);
  103. FairTask* findVtx = new MpdKfPrimaryVertexFinder("Vertex finder");
  104. //fRun->AddTask(findVtx);
  105. MpdTofHitProducer* tofHit = new MpdTofHitProducer("Hit producer");
  106. //fRun->AddTask(tofHit);
  107. MpdTofMatching* tofMatch = new MpdTofMatching("TOF matching");
  108. //fRun->AddTask(tofMatch);
  109. FairTask *tdigi= new MpdZdcDigiProducer("MpdZdcDigiProducer");
  110. fRun->AddTask(tdigi);
  111. FairTask* fillDST = new MpdFillDstTask("MpdDst task");
  112. fRun->AddTask(fillDST);
  113. // Number of events to process
  114. Int_t nEvents = 1; // 100; //50; //250; //90;
  115. if (number_of_events)
  116. nEvents = number_of_events;
  117. // ----- Intialise and run --------------------------------------------
  118. fRun->Init();
  119. cout << "Field: " << fRun->GetField()->GetBz(0.,0.,0.) << endl;
  120. fRun->Run(0, nEvents);
  121. // ------------------------------------------------------------------------
  122. // ----- Finish -------------------------------------------------------
  123. timer.Stop();
  124. Double_t rtime = timer.RealTime();
  125. Double_t ctime = timer.CpuTime();
  126. cout << endl << endl;
  127. cout << "Macro finished succesfully." << endl;
  128. cout << "Output file is " << outFile << endl;
  129. cout << "Parameter file is " << parFile << endl;
  130. cout << "Real time " << rtime << " s, CPU time " << ctime << " s" << endl;
  131. cout << endl;
  132. // ------------------------------------------------------------------------
  133. cout << " Test passed" << endl;
  134. cout << " All ok " << endl;
  135. exit(0);
  136. }