MpdEtofHitProducerIdeal.cxx 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113
  1. //------------------------------------------------------------------------------------------------------------------------
  2. /// \class MpdEtofHitProducerIdeal
  3. ///
  4. /// \brief
  5. /// \author Sergei Lobastov (LHE, JINR, Dubna)
  6. //------------------------------------------------------------------------------------------------------------------------
  7. #include <assert.h>
  8. #include <iostream>
  9. #include "TClonesArray.h"
  10. #include "FairRootManager.h"
  11. #include "FairLogger.h"
  12. #include "MpdTofUtils.h"
  13. #include "MpdTofHit.h"
  14. #include "MpdTofPoint.h"
  15. #include "MpdTofHitProducerQA.h"
  16. #include "MpdEtofHitProducerIdeal.h"
  17. ClassImp(MpdEtofHitProducerIdeal)
  18. using namespace std;
  19. //------------------------------------------------------------------------------------------------------------------------
  20. MpdEtofHitProducerIdeal::MpdEtofHitProducerIdeal(const char *name, Bool_t useMCdata, Int_t verbose, Bool_t test, Bool_t merge, const char *flnm)
  21. : MpdTofHitProducerIdeal(name, useMCdata, verbose, test, merge, flnm, true)
  22. {
  23. }
  24. //------------------------------------------------------------------------------------------------------------------------
  25. MpdEtofHitProducerIdeal::~MpdEtofHitProducerIdeal()
  26. {
  27. }
  28. //------------------------------------------------------------------------------------------------------------------------
  29. InitStatus MpdEtofHitProducerIdeal::Init()
  30. {
  31. /* FairLogger::GetLogger()->Info(MESSAGE_ORIGIN, "[MpdEtofHitProducerIdeal::Init] Begin initialization.");
  32. if(fUseMCData)
  33. {
  34. aMcPoints = (TClonesArray*) FairRootManager::Instance()->GetObject("ETOFPoint");
  35. aMcTracks = (TClonesArray*) FairRootManager::Instance()->GetObject("MCTrack");
  36. assert(aMcPoints);
  37. assert(aMcTracks);
  38. }
  39. else
  40. {
  41. aExpDigits = (TClonesArray*) FairRootManager::Instance()->GetObject("??????");// FIXME: NOW unknown name
  42. assert(aExpDigits);
  43. }
  44. // Create and register output array
  45. aTofHits = new TClonesArray("MpdEtofHit");
  46. FairRootManager::Instance()->Register("ETOFHit", "ETof", aTofHits, kTRUE);
  47. FairLogger::GetLogger()->Info(MESSAGE_ORIGIN, "[MpdEtofHitProducerIdeal::Init] Initialization finished succesfully.");
  48. */
  49. return kSUCCESS;
  50. }
  51. //------------------------------------------------------------------------------------------------------------------------
  52. void MpdEtofHitProducerIdeal::Exec(Option_t* opt)
  53. {
  54. /*
  55. static const TVector3 XYZ_err(0., 0., 0.); // FIXME:
  56. aTofHits->Clear();
  57. Int_t nSingleHits = 0;
  58. TVector3 pos;
  59. if(fUseMCData)
  60. {
  61. for(Int_t pointIndex = 0, nTofPoint = aMcPoints->GetEntriesFast(); pointIndex < nTofPoint; pointIndex++ ) // cycle by TOF points
  62. {
  63. MpdTofPoint *pPoint = (MpdTofPoint*) aMcPoints->UncheckedAt(pointIndex);
  64. pPoint->Position(pos);
  65. AddHit(pPoint->GetDetectorID(), pos, XYZ_err, pointIndex, pPoint->GetTrackID(), pPoint->GetTime(), MpdTofUtils::IsSingle);
  66. nSingleHits++;
  67. }
  68. }
  69. else // exp. data used
  70. {
  71. // FIXME: now not realized
  72. //AddHit(Int_t detUID, const TVector3 &posHit, const TVector3 &posHitErr, Int_t expDigitIndex, Double_t time, Int_t flag)
  73. assert(false);
  74. }
  75. int nFinally;
  76. if(fDoMergeHits)
  77. {
  78. MergeHitsOnStrip(); // save only the fastest hit in the strip
  79. nFinally = CompressHits(); // remove blank slotes
  80. }
  81. else
  82. nFinally = aTofHits->GetEntriesFast();
  83. cout<<" -I- [MpdEtofHitProducerIdeal::Exec] single hits= "<<nSingleHits<<", final hits= "<<nFinally<<endl;
  84. */
  85. }
  86. //------------------------------------------------------------------------------------------------------------------------
  87. /*void MpdEtofHitProducerIdeal::Finish()
  88. {
  89. if(pHitProducerQA) pHitProducerQA->Finish();
  90. }*/
  91. //------------------------------------------------------------------------------------------------------------------------