MpdTpcDigitizerAZlt.h 5.8 KB

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