MpdTpcDigitizerTask.h 5.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122
  1. //--------------------------------------------------------------------
  2. //
  3. // Description:
  4. // Tpc Digitizer reads array of MC points and produces TpcDigits
  5. //
  6. //
  7. // Author List:
  8. // Sergey Merts
  9. //
  10. //--------------------------------------------------------------------
  11. #ifndef MPDTPCDIGITIZERTASK_HH
  12. #define MPDTPCDIGITIZERTASK_HH
  13. // Base Class Headers ----------------
  14. #include "FairTask.h"
  15. #include "MpdMCTrack.h"
  16. #include "FairField.h"
  17. #include "TpcPoint.h"
  18. #include "MpdTpcDigitizerQAHistograms.h"
  19. class TpcGas;
  20. using namespace std;
  21. struct DigOrigArray {
  22. Float_t signal;
  23. map<Int_t, Float_t> origins; // array of pairs <MC-track ID, its signal> for calculating origin
  24. Int_t origin; // MC-track index for testing
  25. Bool_t isOverlap;
  26. };
  27. class MpdTpcDigitizerTask : public FairTask {
  28. public:
  29. // Constructors/Destructors ---------
  30. MpdTpcDigitizerTask();
  31. virtual ~MpdTpcDigitizerTask();
  32. Bool_t isSubtrackInInwards(const TpcPoint *p1, const TpcPoint *p2);
  33. void SetPrimBranchName(const TString& name) { fInputBranchName = name; }
  34. void SetPersistence(Bool_t opt = kTRUE) { fPersistence = opt; }
  35. void SetAttach(Bool_t opt = kTRUE) { fAttach = opt; }
  36. void SetDiffuse(Bool_t opt = kTRUE) { fDiffuse = opt; }
  37. void SetDistort(Bool_t opt = kTRUE) { fDistort = opt; }
  38. void SetDebug(Bool_t opt = kTRUE) { fPrintDebugInfo = opt; }
  39. void SetMakeQA(Bool_t opt = kFALSE) { fMakeQA = opt; }
  40. void SetDistribute(Bool_t opt = kFALSE) { fDistribute = opt; }
  41. void SetResponse(Bool_t opt = kFALSE) { fResponse = opt; }
  42. void SetOnlyPrimary(Bool_t opt = kFALSE) { fOnlyPrimery = opt; }
  43. virtual InitStatus Init();
  44. virtual void Exec(Option_t* opt);
  45. virtual void Finish();
  46. void PadResponse(Float_t x, Float_t y, UInt_t timeID, Int_t origin, DigOrigArray ***arr);
  47. TF1* padResponseFunction();
  48. Float_t CalculatePadResponse(UInt_t padID, UInt_t rowID, Float_t x, Float_t y);
  49. void GetArea(Float_t xEll, Float_t yEll, Float_t radius, vector<UInt_t> &padIDs, vector<UInt_t> &rowIDs);
  50. Int_t CalcOrigin(const DigOrigArray dig);
  51. void TpcProcessing(const TpcPoint* prePoint, const TpcPoint* curPoint, const UInt_t secID, const UInt_t iPoint, const UInt_t nPoints);
  52. private:
  53. // Private Data Members ------------
  54. TString fInputBranchName;
  55. TString fOutputBranchName;
  56. TClonesArray* fMCPointArray; // input array of MC points
  57. TClonesArray* fMCTracksArray; // input array of MC tracks
  58. TClonesArray* fDigits; // output array of TPC digits (write into output tree)
  59. TpcGas* fGas; // pointer to gas system
  60. DigOrigArray ***fDigits4dArray; // output array of digital signals (don't write into output tree)
  61. TpcSector *fSector; // object for getting geometrical parameters of TPC sector
  62. MpdTpcDigitizerQAHistograms *fHisto; // pointer to object needed only for QA creating
  63. TF1* fPRF; // pad response function
  64. FairField* fMagField; // magnetic field
  65. Float_t fGain; // coefficient for avalanches calculating
  66. Float_t zCathode; // length of TPC
  67. Float_t fNoiseThreshold; // threshold for signal separation
  68. Int_t *fNumOfPadsInRow; // array of pads quantity in every TPC rows
  69. UInt_t nSectors; // number of TPC sectors
  70. UInt_t nTimeBackets; // number of time samples in TPC
  71. UInt_t nRows; // number of rows in TPC sector
  72. UInt_t nInRows; // number of rows in inner part of TPC sector
  73. UInt_t nOutRows; // number of rows in outer part of TPC sector
  74. Float_t fSectInHeight; // height of inner part of TPC sector
  75. Float_t fSectHeight; // height of TPC sector
  76. Float_t r_min; // minimal radius of TPC
  77. Float_t fSpread; // sigma for pad response function
  78. Float_t k1, k2; // coefficients for padRespose calculating
  79. Float_t pwIn; // inner pad width
  80. Float_t phIn; // inner pad height
  81. Float_t pwOut; // outer pad width
  82. Float_t phOut; // outer pad height
  83. // set of boolean flags for manage of work process
  84. Bool_t fIsHistogramsInitialized; // is QA histograms initialized or not
  85. Bool_t fMakeQA; // create or not in output tree branch with QA histograms
  86. Bool_t fOnlyPrimery; // Take into account only primery particle or not
  87. Bool_t fPersistence; // print or not output array into tree
  88. Bool_t fAttach; // attach electrons in gas or not
  89. Bool_t fDiffuse; // diffuse electrons in TPC or not
  90. Bool_t fDistort; // not implemented yet
  91. Bool_t fResponse; // to do pad response or not
  92. Bool_t fDistribute; // distribute electrons between two MC points or not
  93. Bool_t fPrintDebugInfo; // print or not additional information in output
  94. public:
  95. ClassDef(MpdTpcDigitizerTask, 5)
  96. };
  97. #endif
  98. //--------------------------------------------------------------
  99. // $Log$
  100. //--------------------------------------------------------------