MpdTpcDigitizerAZ.h 5.7 KB

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