19 #ifndef PNDMDTPARAMDIGI_H 20 #define PNDMDTPARAMDIGI_H 1 23 #include "TGraphErrors.h" 59 PndMdtParamDigi &SetParams(Int_t ptlType, TVector3 iniP, TVector3 iniPos, TVector3 finalPos, Double_t stripLen = 100.);
61 void UseNoise(Bool_t swith) { fUseNoise = swith; }
63 void UsePlot(Bool_t swith = kTRUE) { fUsePlot = swith; }
68 fNoiseSigmaAnode = anode;
69 fNoiseSigmaStrip = strip;
75 std::vector<std::pair<Int_t, Double_t>> GetFiredInfo();
77 void Compute(Bool_t useConvolution = kTRUE);
79 const std::vector<Double_t> &
GetWireSignal()
const {
return fSignalDataAnode; }
80 const std::map<Int_t, std::vector<Double_t>> &
GetStripSignals()
const {
return fSignalDataStripM; }
88 void GetSignal(Bool_t useConvolution = kTRUE);
92 Bool_t Digitize(Double_t &time, Double_t &);
93 Bool_t Digitize(Int_t stripNo, Double_t &time, Double_t &);
95 void GetRawSignalbySimAvalanche(Double_t fNoiseLevel = 1.);
96 void GetRawSignalbyWeightingAvalanche(Double_t fNoiseLevel = 1.);
97 void AddNoise(Double_t fNoiseLevel = 1., Int_t isAnode = 1);
98 void ApplyTransferFunction(Double_t *fSignalData, Int_t nSize = fSamplingSize);
101 static const Int_t fSamplingSize = 20;
103 Int_t fSamplingInterval;
104 std::vector<Double_t> fSignalDataAnode;
105 std::map<Int_t, std::vector<Double_t>> fSignalDataStripM;
109 Double_t fNoiseSigmaAnode;
110 Double_t fNoiseSigmaStrip;
111 Int_t fNumofTruncation;
115 inline Double_t GetElectronDriftTime(TVector2 iniPos)
117 const Double_t p0 = 5.35513e+03;
118 const Double_t p1 = 3.92749e+02;
119 const Double_t p2 = -5.41433e+03;
120 const Double_t p3 = -3.31810e+03;
121 Double_t x = iniPos.Mod() - cWIRERADIUS;
122 Double_t x1 =
log(1. + x);
123 return (x * (p0 + p1 * pow(x, 0.25)) + x1 * (p2 + p3 * x1));
126 inline Double_t GetShiftTime(TVector2 fWireSurfacePos, TVector2 fProductionPos)
128 const Double_t p0 = 1.81940e-8;
129 const Double_t p1 = 1.80248;
130 const Double_t p2 = 3.68652e+2;
131 const Double_t p3 = 1.67353e+3;
134 Double_t dr = (fProductionPos - fWireSurfacePos).Mod();
135 return (((p3 * dr + p2) * dr + p1) * dr + p0 ) * 1.e3;
140 TVector3 fParticleMomentum;
141 TVector3 fInitPostion;
142 TVector3 fExitPosition;
143 Bool_t fParamsChanged;
144 Double_t fStripLength;
145 Double_t fRestMass[5];
147 void GetMPVofPrimaryIonization(Int_t particleType,
const TVector3 &momentum,
ValueErrorType &val)
const;
148 Int_t GetAmplicationFactor(Int_t particleType, Double_t momentum)
const;
151 void SamplingPosition(TVector2 fDirection, TVector2 &fIonProductionPos);
153 TGraphErrors *gFreePath[5];
155 inline Double_t GetMeanFreePath(Int_t ptlType, Double_t mom)
const 157 Double_t mMass = fRestMass[ptlType];
159 Double_t mBeta = mom / mMass;
160 Double_t mPath = gFreePath[ptlType]->Eval(mBeta);
161 return gRandom->Exp(mPath);
172 static const Int_t NRAD = 100;
173 static const Int_t NPHI = 100;
175 Double_t cWIRERADIUS;
177 Double_t cSTRIPWIDTH;
182 TH1F *hAnodeI1d[NRAD];
183 TH1F *hCathodeI2d[NRAD][NPHI];
185 Int_t fNrNphi[NRAD * NPHI];
189 explicit ClusInfo(TVector3 _v = TVector3()) : fPosition(_v) {}
191 Int_t fNumofPrimaryIonization;
192 Int_t fNumofIonsofThisCluster;
215 AvaBinType(Int_t _i = 0, Double_t _v = 0.) : Index(_i), Probabilty(_v) {}
220 std::vector<AvaBinType> fProbFunc1D;
221 std::vector<AvaBinType> fProbFunc2D;
224 Double_t SPEEDOFLIGHT;
225 CLHEP::RandGeneral *fRandAva;
std::pair< Double_t, Double_t > ValueErrorType
void UseGaussianAmp(Bool_t swith)
void SetNoiseWidth(Double_t anode, Double_t strip)
friend F32vec4 log(const F32vec4 &a)
const std::vector< Double_t > & GetWireSignal() const
void UsePlot(Bool_t swith=kTRUE)
const std::map< Int_t, std::vector< Double_t > > & GetStripSignals() const
AvaBinType(Int_t _i=0, Double_t _v=0.)
void UseDetailedSim(Bool_t swith=kTRUE)
void UseNoise(Bool_t swith)
void SetOptimization(Int_t val)