MpdEmcSimParams.h 6.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132
  1. #ifndef MPDEMCDETSIMPARAMS_H
  2. #define MPDEMCDETSIMPARAMS_H
  3. #include "TObject.h"
  4. class MpdEmcSimParams : public TObject
  5. {
  6. public:
  7. /// Default constructor.
  8. /// It must be kept public for root persistency purposes,
  9. /// but should never be called by the outside world
  10. MpdEmcSimParams() {}
  11. ///
  12. /// Destructor.
  13. ///
  14. ~MpdEmcSimParams() {}
  15. ///
  16. /// \return the pointer of the _existing_ unique instance of the geometry
  17. /// It should have been set before with GetInstance(name) method
  18. ///
  19. static MpdEmcSimParams* GetInstance()
  20. {
  21. if (!sParams) {
  22. sParams = new MpdEmcSimParams();
  23. }
  24. return sParams;
  25. }
  26. // Parameters to configure Digitization
  27. bool SimulateNoise() const { return fSimulateNoise; }
  28. bool CorrectZ() const { return fCorrectZ; }
  29. bool ApplyNonLinearity() const { return fApplyNonlinearity; }
  30. bool ApplyDigitization() const { return fApplyDigitization; }
  31. bool ApplyTimeResolution() const { return fApplyTimeResolution; }
  32. double ElectronicNoise() const { return fElectronicNoiseWidth; }
  33. void CellNonLineaityParams(double& a, double& b, double& c) const
  34. {
  35. a = fCelNonlinParamA;
  36. b = fCelNonlinParamC;
  37. b = fCelNonlinParamC;
  38. }
  39. double ADCwidth() const { return fADCWidth; }
  40. double ZSthreshold() const { return fZSthreshold; }
  41. void TimeResolutionParams(double& a, double& b)
  42. {
  43. a = fTimeResolitionParamA;
  44. b = fTimeResolitionParamB;
  45. }
  46. void NoiseTimeRange(double& a, double& b) const
  47. {
  48. a = fNoiseTimeMin;
  49. b = fNoiseTimeMax;
  50. }
  51. bool SmearLightCollection() const { return fSmearLightCollection; }
  52. double GetLYPerGeV() const { return fEdepToLightYield; }
  53. // Parameters to configure Clusterization
  54. bool AllowMultiSectorClusters() const { return fMultiSectorClusters; }
  55. double DigitMinEnergy() const { return fDigitMinEnergy; }
  56. double ClusteringThreshold() const { return fClusteringThreshold; }
  57. double LogWeight() const { return fLogWeight; }
  58. double LocalMaximumCut() const { return fLocalMaximumCut; }
  59. double ClusteringTimeGate() const { return fClusteringTimeGate; }
  60. bool UnfoldClusters() const { return fUnfoldClusters; }
  61. double UnfogingEAccuracy() const { return fUnfogingEAccuracy; }
  62. double UnfogingXZAccuracy() const { return fUnfogingXZAccuracy; }
  63. double EcoreCut1() const { return fEcoreCut1; }
  64. double EcoreCut2() const { return fEcoreCut2; }
  65. double Chi2radiusCut() const { return fChi2radiusCut; }
  66. int NMaxIterations() const { return fNMaxIterations; }
  67. int NLMMax() const { return fNLMMax; }
  68. int NPrimMax() const { return fNPrimMax; }
  69. double ENonLinCorrection(int index)const{return fNonLinCorrection[index];}
  70. // Parameters for cluster position correction (See MpdEmcCluster::CorrectVertex)
  71. double ZcorrSinA(int indx) const { return fZcorrSinA[indx]; }
  72. double ZcorrSinW(int indx) const { return fZcorrSinW[indx]; }
  73. double ZcorrA(int indx) const { return fZcorrA[indx]; }
  74. double ZcorrB(int indx) const { return fZcorrB[indx]; }
  75. private:
  76. static MpdEmcSimParams* sParams; // Pointer to the unique instance of the singleton
  77. public: // One can set parameters in configure macros, but use for access parameters only dedicated methods
  78. bool fCorrectZ = false; // Apply theta/zed correction
  79. bool fSmearLightCollection = false; // Emulate smearing and collecting light using fEdepToLightYield photoelectrons per GeV
  80. bool fSimulateNoise = false; // Simulate electronic noise in HitCreation
  81. bool fApplyNonlinearity = false; // Apply energy non-linearity in HitCreation
  82. bool fApplyDigitization = false; // Apply digitization of energy in HitCreation
  83. bool fApplyTimeResolution = false; // Apply time resolution in HitCreation
  84. double fElectronicNoiseWidth = 0.005; // Width of Gaussian electronic noise in GeV
  85. double fCelNonlinParamA = -0.02; // Cell energy non-linearity parameterization
  86. double fCelNonlinParamB = 0.5; // in the form
  87. double fCelNonlinParamC = 1.0; // e=e*c(1-a*exp(-e/b))
  88. double fADCWidth = 0.005; // Widht of one ADC count in GeV (used in energy digitization in HitCreation)
  89. double fZSthreshold = 0.0015; // ZeroSuppression threshold (remove digits below) in GeV
  90. double fTimeResolitionParamA = 5.e-10; // Parameters used for time resolution simulation
  91. double fTimeResolitionParamB = 2.e-11; // in the form width = a + b/e (in seconds)
  92. double fNoiseTimeMin = -100.e-9; // simulate noise signal
  93. double fNoiseTimeMax = 100.e-9; // in this range (in seconds)
  94. double fEdepToLightYield = 200000.; // Number of photoelectrons per GeV
  95. // Clusterization
  96. bool fMultiSectorClusters = true; // allow clusters with digits in different sectors
  97. double fLogWeight = 3.1; // cutoff used in log. weight calculation
  98. double fDigitMinEnergy = 0.0015; // Minimal energy of digits to be used in cluster (GeV)
  99. double fClusteringThreshold = 0.010; // Minimal energy of digit to start clustering (GeV)
  100. double fLocalMaximumCut = 0.0015; // minimal height of local maximum over neighbours
  101. double fClusteringTimeGate = 1e9; // maximal time difference between digits to be accepted to clusters (in ns)
  102. bool fUnfoldClusters = true; // to perform cluster unfolding
  103. double fUnfogingEAccuracy = 1.e-4; // accuracy of energy calculation in unfoding prosedure (GeV)
  104. double fUnfogingXZAccuracy = 1.e-2; // accuracy of position calculation in unfolding procedure (cm)
  105. double fEcoreCut1 = 0.01; // threshold for Ecore calculation E_p1
  106. double fEcoreCut2 = 0.02; // threshold for Ecore calculation E_p2
  107. double fChi2radiusCut = 0.0001; // cut in dispersion Chi2
  108. int fNMaxIterations = 100; // maximal number of iterations in unfolding procedure
  109. int fNLMMax = 30; // Maximal number of local maxima in unfolding
  110. int fNPrimMax = 5; // Maximal number of primaries in list (sorted with deposited energy)
  111. float fNonLinCorrection[2] = {0.0, 1.0} ; //Parameters for Nonlinearity correction: Ecorr=[0]+[1]*E
  112. float fZcorrSinA[2] = {-0.5588, -0.042}; // Parameters for cluster position correction (See MpdEmcCluster::CorrectVertex)
  113. float fZcorrSinW[2] = {52.7, 0.4}; // Parameters for cluster position correction
  114. float fZcorrA[2] = {0.07887, 0.0101}; // Parameters for cluster position correction
  115. float fZcorrB[2] = {0.00256, 0.00032}; // Parameters for cluster position correction
  116. ClassDef(MpdEmcSimParams, 1)
  117. };
  118. #endif