MpdTpcClusterFinderTask.h 5.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117
  1. //-----------------------------------------------------------
  2. // File and Version Information:
  3. // $Id$
  4. //
  5. // Description:
  6. // Takes ADC signals and find primary cluster
  7. //
  8. //
  9. // Environment:
  10. // Software developed for the MPD at NICA.
  11. //
  12. // Author List:
  13. // Sergey Merts
  14. // Dmitry Sosnov
  15. // Artem Basalaev
  16. //
  17. //
  18. //-----------------------------------------------------------
  19. #ifndef MPDTPCCLUSTERFINDERTASK_HH
  20. #define MPDTPCCLUSTERFINDERTASK_HH
  21. #include "TMath.h"
  22. #include "FairTask.h"
  23. #include "MpdTpcClusterFinderQAHistograms.h"
  24. #include "MpdTpcDigitizerTask.h"
  25. #include "MpdTpc2dCluster.h"
  26. #include "TRefArray.h"
  27. #include "MpdTpcPeak.h"
  28. #include "MpdTpcFoundHit.h"
  29. #include "MpdTpcDigit.h"
  30. #include "TpcGas.h"
  31. using namespace std;
  32. class TpcGas;
  33. class TClonesArray;
  34. class MpdTpcClusterFinderTask : public FairTask {
  35. public:
  36. MpdTpcClusterFinderTask();
  37. virtual ~MpdTpcClusterFinderTask();
  38. // Modifiers -----------------------
  39. void SetPersistence(Bool_t opt=kTRUE) {fPersistence = opt;}
  40. void SetDebug(Bool_t opt=kTRUE) {fPrintDebugInfo = opt;}
  41. void SetMakeQA(Bool_t opt=kTRUE) {fMakeQA = opt;}
  42. void SetCalcResiduals(Bool_t opt=kTRUE) {fCalcResiduals = opt;}
  43. void SetResFileName(TString opt) {fNameResFile = opt;}
  44. // Operations ----------------------
  45. virtual InitStatus Init();
  46. virtual void Exec(Option_t* opt);
  47. virtual void Finish();
  48. Bool_t Find2DClusters(vector<MpdTpc2dCluster*> *extClust, DigOrigArray **digArr, UInt_t row, UInt_t sec);
  49. void FindPeaksInCluster(MpdTpc2dCluster* clust, vector<MpdTpcPeak*> *peakList, DigOrigArray** fOriginsArray);
  50. //void FindPeaksInClusterNew(MpdTpc2dCluster* clust, vector<MpdTpcPeak*> *peakList, DigOrigArray** fOriginsArray);
  51. void CollectPeaks(vector<MpdTpcPeak*> peakList, MpdTpc2dCluster* clust, vector<MpdTpcPeak*> *collectedPeakList);
  52. void CreateHit(vector<MpdTpcPeak*> collectedPeakList, MpdTpc2dCluster* clust, vector<MpdTpcFoundHit*> *hitList, DigOrigArray** fOriginsArray);
  53. Bool_t GetNextDigit(UInt_t* currDig, MpdTpc2dCluster* Clus2d, DigOrigArray **digArr, Bool_t **fADCMarks);
  54. void FitPeaks(vector<MpdTpcPeak*> PeakList, Int_t npeaks[], Int_t mincol) ;
  55. void LinGammaFit(Float_t lnq[], Float_t w[], Float_t dt[], Float_t lndt[], Int_t nbin, Float_t par[], Float_t epar[], Float_t& chi2);
  56. void CalcResiduals(MpdTpcFoundHit* hit, Float_t phi);
  57. void CalcNewErrors(MpdTpcFoundHit* hit);
  58. private:
  59. // Private Data Members ------------
  60. TString inputBranchName;
  61. TString outputBranchName;
  62. Int_t OnePeakCntr, MoreThenOnePeakCntr, OneDigitHitCntr, AllCntr, ThreePadsCntr;//TMP
  63. TpcGas* fGas; // pointer to gas system
  64. TClonesArray* fDigits; // input TClonesArray of TPC digits
  65. TClonesArray* fHitsArray; // output TClonesArray of TPC hits
  66. TClonesArray* fMCPointArray; // input TClonesArray of MC points. It's needed only for residuals calculating
  67. TClonesArray* fMCTracks; // input TClonesArray of MC tracks. It's needed only for residuals calculating
  68. DigOrigArray ***fDigitsArray; // input 4D-array of TPC digits
  69. MpdTpcClusterFinderQAHistograms* fHisto; // pointer to object needed for QA creating
  70. // set of boolean flags for manage of work process
  71. Bool_t fPersistence; // print or not output array into tree
  72. Bool_t fPrintDebugInfo; // print or not additional information in output
  73. Bool_t isHistogramsInitialized; // is QA histograms initialized or not
  74. Bool_t fMakeQA; // create or not in output tree branch with QA histograms
  75. Bool_t fCalcResiduals; // calculate residuals of TPC hits or not
  76. Bool_t fitGamma; // not used now
  77. Float_t fSpread; // sigma for pad response function
  78. Float_t zDrift; // length of TPC
  79. Float_t r_min; // minimal radius of TPC
  80. UInt_t fEventId; // event number
  81. UInt_t nSect; // number of sectors in TPC
  82. UInt_t nTimeBins; // number of time samples in TPc
  83. Float_t pwIn, phIn; // inner pad width and height
  84. Float_t pwOut, phOut; // outer pad width and height
  85. UInt_t nRows; // number of rows in TPC sector
  86. UInt_t nInRows; // number of rows in inner part of TPC sector
  87. UInt_t nOutRows; // number of rows in outer part of TPC sector
  88. UInt_t *fNumOfPadsInRow; // array of pads quantity in every TPC rows
  89. Float_t fSectInHeight; // height of inner part of TPC sector
  90. Float_t fNoiseThreshold; // threshold for signal separation
  91. TString fNameResFile; // name of output residuals file
  92. public:
  93. ClassDef(MpdTpcClusterFinderTask, 6)
  94. };
  95. #endif
  96. //--------------------------------------------------------------
  97. // $Log$
  98. //--------------------------------------------------------------