7 #ifndef PNDMDTPARAMDIGI_H 8 #define PNDMDTPARAMDIGI_H 1 11 #include "TGraphErrors.h" 47 PndMdtParamDigi &SetParams(Int_t ptlType, TVector3 iniP, TVector3 iniPos, TVector3 finalPos, Double_t stripLen = 100.);
49 void UseNoise(Bool_t swith) { fUseNoise = swith; }
51 void UsePlot(Bool_t swith = kTRUE) { fUsePlot = swith; }
56 fNoiseSigmaAnode = anode;
57 fNoiseSigmaStrip = strip;
63 std::vector<std::pair<Int_t, Double_t>> GetFiredInfo();
65 void Compute(Bool_t useConvolution = kTRUE);
67 const std::vector<Double_t> &
GetWireSignal()
const {
return fSignalDataAnode; }
68 const std::map<Int_t, std::vector<Double_t>> &
GetStripSignals()
const {
return fSignalDataStripM; }
76 void GetSignal(Bool_t useConvolution = kTRUE);
80 Bool_t Digitize(Double_t &time, Double_t &);
81 Bool_t Digitize(Int_t stripNo, Double_t &time, Double_t &);
83 void GetRawSignalbySimAvalanche(Double_t fNoiseLevel = 1.);
84 void GetRawSignalbyWeightingAvalanche(Double_t fNoiseLevel = 1.);
85 void AddNoise(Double_t fNoiseLevel = 1., Int_t isAnode = 1);
86 void ApplyTransferFunction(Double_t *fSignalData, Int_t nSize = fSamplingSize);
89 static const Int_t fSamplingSize = 20;
91 Int_t fSamplingInterval;
92 std::vector<Double_t> fSignalDataAnode;
93 std::map<Int_t, std::vector<Double_t>> fSignalDataStripM;
97 Double_t fNoiseSigmaAnode;
98 Double_t fNoiseSigmaStrip;
99 Int_t fNumofTruncation;
103 inline Double_t GetElectronDriftTime(TVector2 iniPos)
105 const Double_t p0 = 5.35513e+03;
106 const Double_t p1 = 3.92749e+02;
107 const Double_t p2 = -5.41433e+03;
108 const Double_t p3 = -3.31810e+03;
109 Double_t x = iniPos.Mod() - cWIRERADIUS;
110 Double_t x1 =
log(1. + x);
111 return (x * (p0 + p1 * pow(x, 0.25)) + x1 * (p2 + p3 * x1));
114 inline Double_t GetShiftTime(TVector2 fWireSurfacePos, TVector2 fProductionPos)
116 const Double_t p0 = 1.81940e-8;
117 const Double_t p1 = 1.80248;
118 const Double_t p2 = 3.68652e+2;
119 const Double_t p3 = 1.67353e+3;
122 Double_t dr = (fProductionPos - fWireSurfacePos).Mod();
123 return (((p3 * dr + p2) * dr + p1) * dr + p0 ) * 1.e3;
128 TVector3 fParticleMomentum;
129 TVector3 fInitPostion;
130 TVector3 fExitPosition;
131 Bool_t fParamsChanged;
132 Double_t fStripLength;
133 Double_t fRestMass[5];
135 void GetMPVofPrimaryIonization(Int_t particleType,
const TVector3 &momentum,
ValueErrorType &val)
const;
136 Int_t GetAmplicationFactor(Int_t particleType, Double_t momentum)
const;
139 void SamplingPosition(TVector2 fDirection, TVector2 &fIonProductionPos);
141 TGraphErrors *gFreePath[5];
143 inline Double_t GetMeanFreePath(Int_t ptlType, Double_t mom)
const 145 Double_t mMass = fRestMass[ptlType];
147 Double_t mBeta = mom / mMass;
148 Double_t mPath = gFreePath[ptlType]->Eval(mBeta);
149 return gRandom->Exp(mPath);
160 static const Int_t NRAD = 100;
161 static const Int_t NPHI = 100;
163 Double_t cWIRERADIUS;
165 Double_t cSTRIPWIDTH;
170 TH1F *hAnodeI1d[NRAD];
171 TH1F *hCathodeI2d[NRAD][NPHI];
173 Int_t fNrNphi[NRAD * NPHI];
177 explicit ClusInfo(TVector3 _v = TVector3()) : fPosition(_v) {}
179 Int_t fNumofPrimaryIonization;
180 Int_t fNumofIonsofThisCluster;
203 AvaBinType(Int_t _i = 0, Double_t _v = 0.) : Index(_i), Probabilty(_v) {}
208 std::vector<AvaBinType> fProbFunc1D;
209 std::vector<AvaBinType> fProbFunc2D;
212 Double_t SPEEDOFLIGHT;
213 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)