MpdTpcClusterFinderMlem.h 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117
  1. //-----------------------------------------------------------
  2. // File and Version Information:
  3. // $Id$
  4. //
  5. // Description:
  6. // TpcClusterFinderMlem reads in TPC digits and reconstructs clusters and hits
  7. //
  8. //
  9. // Environment:
  10. // Software developed for the MPD Detector at NICA.
  11. //
  12. // Author List:
  13. // Alexandr Zinchenko LHEP, JINR, Dubna - 11-January-2016
  14. //
  15. //-----------------------------------------------------------
  16. #ifndef MPDTPCCLUSTERFINDERMLEM_HH
  17. #define MPDTPCCLUSTERFINDERMLEM_HH
  18. // Base Class Headers ----------------
  19. #include "FairTask.h"
  20. #include <TMatrixD.h>
  21. #include <TVector3.h>
  22. #include <set>
  23. #include <vector>
  24. #include <map>
  25. // Collaborating Class Headers -------
  26. // Collaborating Class Declarations --
  27. class MpdTpc2dCluster;
  28. class MpdTpcSectorGeo;
  29. class TClonesArray;
  30. class TH2D;
  31. //class TMatrixD;
  32. class MpdTpcClusterFinderMlem : public FairTask {
  33. public:
  34. // Constructors/Destructors ---------
  35. MpdTpcClusterFinderMlem();
  36. ~MpdTpcClusterFinderMlem();
  37. // Operators
  38. // Accessors -----------------------
  39. // Modifiers -----------------------
  40. void SetPersistence(Bool_t opt = kTRUE) { fPersistence = opt; }
  41. // Operations ----------------------
  42. virtual InitStatus Init();
  43. void FinishTask();
  44. virtual void Exec(Option_t* opt);
  45. //virtual void Clear(Option_t* opt);
  46. struct pixel {
  47. Double_t qq;
  48. Int_t ix;
  49. Int_t iy;
  50. Double_t vis;
  51. Double_t sum;
  52. };
  53. private:
  54. // Private Data Members ------------
  55. static const Int_t fgkNsec2 = 24; // number of readout sectors (12 * 2)
  56. static const Int_t fgkNpads = 128, fgkNtimes = 512; // max number of pads and time bins
  57. //AZ static const Int_t fgkOvfw = 4095; // overflow value
  58. static const Int_t fgkOvfw = 1023; // overflow value - 10 bits
  59. TClonesArray* fDigiArray;
  60. TClonesArray* fClusArray;
  61. TClonesArray* fHitArray;
  62. //TClonesArray** fPrimArray;
  63. std::set<Int_t>* fDigiSet[fgkNsec2];
  64. Double_t fCharges[fgkNpads][fgkNtimes];
  65. Int_t fFlags[fgkNpads][fgkNtimes];
  66. Int_t fDigis[fgkNpads][fgkNtimes];
  67. Bool_t fPersistence;
  68. MpdTpcSectorGeo* fSecGeo;
  69. // Private Methods -----------------
  70. void ProcessPadrow(Int_t isec, Int_t irow); // process one padrow of a sector
  71. void NextPixel(MpdTpc2dCluster* clus, Int_t ipad, Int_t itime); // add next pixel to the cluster
  72. void FindHits(); // find hits
  73. void Mlem(Int_t iclus, std::multimap<Double_t,Int_t> &localMax); // MLEM procedure
  74. //bool myfunc(const pixel i, const pixel j); // sorting function
  75. //static Bool_t SortPix(const pixel i, const pixel j); // sorting function
  76. void GetResponse(const MpdTpc2dCluster* clus, TH2D *hXY, TH2D *hOvfw,
  77. Double_t &sigt, Double_t &sigp, Double_t &correl); // get response parameters
  78. Double_t GetCij(Int_t irow, Double_t x0, Double_t y0, Double_t x1, Double_t y1,
  79. Double_t sigt, Double_t sigp, Double_t correl, Double_t &vis); // compute pixel-to-bin couplings
  80. void PeakAndValley(const MpdTpc2dCluster* clus, std::multimap<Double_t,Int_t> &localMax); // peak-and-valley
  81. void PeakAndValley(const std::vector<pixel> &pixels, std::multimap<Double_t,Int_t> &localMax,
  82. std::vector<std::vector<Double_t> > &charges, std::vector<std::vector<Int_t> > &flags); // peak-and-valley in pixel domain
  83. void CreateHits(const std::vector<pixel> &pixels, std::multimap<Double_t,Int_t> &localMax,
  84. std::vector<std::vector<Double_t> > &charges, std::vector<std::vector<Int_t> > &flags,
  85. Int_t iclus, std::vector<std::multimap<Double_t,Int_t> > &pixInMax); // create hits from pixels
  86. void CorrectReco(TVector3 &p3loc, TVector3 &p3err, Int_t nPads, Double_t adc); // correct reco coordinates and errors
  87. void CorrectRecoMlem(TVector3 &p3loc, TVector3 &p3errCor, MpdTpc2dCluster *clus, Double_t adc); // after MLEM
  88. void ChargeMlem(Int_t nHits0, std::vector<pixel> &pixels, std::vector<pixel> &bins,
  89. std::vector<std::multimap<Double_t,Int_t> > &pixInMax, const TMatrixD &cij, Double_t cijMin); // correct hit charges after MLEM
  90. ClassDef(MpdTpcClusterFinderMlem,0)
  91. };
  92. #endif
  93. //--------------------------------------------------------------
  94. // $Log$
  95. //--------------------------------------------------------------