51 ParAveT2(0.), ParSigLogT1(0.), ParSigLogT2(0.),
52 ParSigLogA1(0.), ParSigLogA2(0.), ParRho1(0.), ParRho2(0.), ParsAveA2(0.),
53 AveLogAlphah(0.), AveLogTmaxh(0.), SigmaLogAlphah(0.), SigmaLogTmaxh(0.),
54 Rhoh(0.), Alphah(0.), Tmaxh(0.), Betah(0.), AveLogAlpha(0.), AveLogTmax(0.),
55 SigmaLogAlpha(0.), SigmaLogTmax(0.), Rho(0.),
Alpha(0.), Tmax(0.), Beta(0.)
100 ParWC5 = thePar->
ParWC5();
101 ParWC6 = thePar->
ParWC6();
102 ParRT1 = thePar->
ParRT1();
103 ParRT2 = thePar->
ParRT2();
104 ParRT3 = thePar->
ParRT3();
105 ParRT4 = thePar->
ParRT4();
106 ParRT5 = thePar->
ParRT5();
107 ParRT6 = thePar->
ParRT6();
138 G4cout <<
"/********************************************/ " <<
G4endl;
139 G4cout <<
" - GFlashSamplingShowerParameterisation::Constructor - " <<
G4endl;
140 G4cout <<
"/********************************************/ " <<
G4endl;
161 Ec1 = 2.66 * std::pow((X01 * Z1 / A1),1.1);
169 Ec2 = 2.66 * std::pow((X02 * Z2 / A2),1.1);
178 G4cout <<
"/************ ComputeZAX0EFFetc ************/" <<
G4endl;
179 G4cout <<
" - GFlashSamplingShowerParameterisation::Material - " <<
G4endl;
184 G4double denominator = (d1*density1 + d2*density2);
185 G4double W1 = (d1*density1) / denominator;
186 G4double W2 = (d2*density2) / denominator;
187 Zeff = ( W1*Z1 ) + ( W2*Z2 );
188 Aeff = ( W1*A1 ) + ( W2*A2 );
189 Rhoeff = ( (d1 *density1 ) + (d2 * density2 ))/
G4double (d2 + d1 );
190 X0eff = (W1 * Rhoeff) / (X01 * density1) + (W2 * Rhoeff) / (X02 * density2 );
192 Rmeff = 1/ ((((W1*Ec1)/ X01) + ((W2* Ec2)/ X02) ) / Es ) ;
193 Eceff = X0eff *((W1*Ec1)/ X01 + (W2* Ec2)/ X02 );
194 Fs = X0eff/
G4double ((d1/mm )+(d2/mm) );
195 ehat = (1. / (1+ 0.007*(Z1- Z2)));
199 G4cout <<
"effective quantities Zeff = "<<Zeff<<
G4endl;
200 G4cout <<
"effective quantities Aeff = "<<Aeff<<
G4endl;
201 G4cout <<
"effective quantities Rhoeff = "<<Rhoeff/g *cm3<<
" g/cm3" <<
G4endl;
202 G4cout <<
"effective quantities X0eff = "<<X0eff/cm <<
" cm" <<
G4endl;
204 X0eff = X0eff * Rhoeff;
206 G4cout <<
"effective quantities X0eff = "<<X0eff/g*cm2 <<
" g/cm2" <<
G4endl;
207 X0eff = X0eff /Rhoeff;
208 G4cout <<
"effective quantities RMeff = "<<Rmeff/cm<<
" cm" <<
G4endl;
209 Rmeff = Rmeff* Rhoeff;
210 G4cout <<
"effective quantities RMeff = "<<Rmeff/g *cm2<<
" g/cm2" <<
G4endl;
211 Rmeff = Rmeff/ Rhoeff;
212 G4cout <<
"effective quantities Eceff = "<<Eceff/MeV<<
" MeV"<<
G4endl;
215 G4cout <<
"/********************************************/ " <<
G4endl;
223 if ((material1==0) || (material2 ==0))
225 G4Exception(
"GFlashSamplingShowerParameterisation::GenerateLongitudinalProfile()",
229 ComputeLongitudinalParameters(y);
230 GenerateEnergyProfile(y);
231 GenerateNSpotProfile(y);
237GFlashSamplingShowerParameterisation::ComputeLongitudinalParameters(
G4double y)
239 AveLogTmaxh = std::log(std::max(ParAveT1 +std::log(y),0.1));
240 AveLogAlphah = std::log(std::max(ParAveA1 + (ParAveA2+ParAveA3/Zeff)*std::log(y),.1));
242 SigmaLogTmaxh = std::min(0.5,1.00/( ParSigLogT1 + ParSigLogT2*std::log(y)) );
243 SigmaLogAlphah = std::min(0.5,1.00/( ParSigLogA1 + ParSigLogA2*std::log(y)));
244 Rhoh = ParRho1+ParRho2*std::log(y);
246 AveLogTmax = std::max(0.1,std::log(std::exp(AveLogTmaxh)
247 + ParsAveT1/Fs + ParsAveT2*(1-ehat)));
248 AveLogAlpha = std::max(0.1,std::log(std::exp(AveLogAlphah)
251 SigmaLogTmax = std::min(0.5,1.00/( ParsSigLogT1
252 + ParsSigLogT2*std::log(y)) );
253 SigmaLogAlpha = std::min(0.5,1.00/( ParsSigLogA1
254 + ParsSigLogA2*std::log(y)));
255 Rho = ParsRho1+ParsRho2*std::log(y);
260void GFlashSamplingShowerParameterisation::GenerateEnergyProfile(
G4double )
262 G4double Correlation1 = std::sqrt((1+Rho)/2);
263 G4double Correlation2 = std::sqrt((1-Rho)/2);
264 G4double Correlation1h = std::sqrt((1+Rhoh)/2);
265 G4double Correlation2h = std::sqrt((1-Rhoh)/2);
266 G4double Random1 = G4RandGauss::shoot();
267 G4double Random2 = G4RandGauss::shoot();
269 Tmax = std::max(1.,std::exp( AveLogTmax + SigmaLogTmax *
270 (Correlation1*Random1 + Correlation2*Random2) ));
271 Alpha = std::max(1.1,std::exp( AveLogAlpha + SigmaLogAlpha *
272 (Correlation1*Random1 - Correlation2*Random2) ));
273 Beta = (Alpha-1.00)/Tmax;
275 Tmaxh = std::exp( AveLogTmaxh + SigmaLogTmaxh *
276 (Correlation1h*Random1 + Correlation2h*Random2) );
277 Alphah = std::exp( AveLogAlphah + SigmaLogAlphah *
278 (Correlation1h*Random1 - Correlation2h*Random2) );
279 Betah = (Alphah-1.00)/Tmaxh;
284void GFlashSamplingShowerParameterisation::GenerateNSpotProfile(
const G4double y)
286 TNSpot = Tmaxh * (ParsSpotT1+ParsSpotT2*Zeff);
287 TNSpot = std::max(0.5,Tmaxh * (ParsSpotT1+ParsSpotT2*Zeff));
288 AlphaNSpot = Alphah * (ParsSpotA1+ParsSpotA2*Zeff);
289 BetaNSpot = (AlphaNSpot-1.00)/TNSpot;
290 NSpot = ParsSpotN1 /SamplingResolution * std::pow(y*Eceff/GeV,ParsSpotN2 );
300 G4double Resolution = std::pow(SamplingResolution,2);
307 if(Resolution >0.0 && DEne > 0.00)
310 G4float x2 = G4RandGamma::shoot(x1, 1.0)*Resolution;
313 return DEneFluctuated;
321 G4double LongitudinalStepInX0 = LongitudinalStep / X0eff;
322 G4float x1= Betah*LongitudinalStepInX0;
324 float x3 =
gam(x1,x2);
334 G4double LongitudinalStepInX0 = LongitudinalStep / X0eff;
335 G4float x1 = BetaNSpot*LongitudinalStepInX0;
359 if(Random1 <WeightCore)
361 Radius = Rmeff * RadiusCore * std::sqrt( Random2/(1. - Random2) );
365 Radius = Rmeff * RadiusTail * std::sqrt( Random2/(1. - Random2) );
367 Radius = std::min(Radius,
DBL_MAX);
377 G4double tau = LongitudinalPosition / Tmax/ X0eff
378 * (Alpha-1.00) /Alpha
379 * std::exp(AveLogAlpha)/(std::exp(AveLogAlpha)-1.);
388 G4double z1 = ParRC1 + ParRC2* std::log(Energy/GeV);
390 RadiusCore = z1 + z2 * Tau;
393 G4double p3 = ParWC5+ParWC6*std::log(Energy/GeV);
394 WeightCore = p1 * std::exp( (p2-Tau)/p3- std::exp( (p2-Tau) /p3) );
399 G4double k4 = ParRT5+ParRT6* std::log(Energy/GeV);
401 RadiusTail = k1*(std::exp(k3*(Tau-k2))
402 + std::exp(k4*(Tau-k2)) );
406 RadiusCore = RadiusCore + ParsRC1*(1-ehat) + ParsRC2/Fs*std::exp(-Tau);
407 WeightCore = WeightCore + (1-ehat)
408 * (ParsWC1+ParsWC2/Fs * std::exp(-std::pow((Tau-1.),2)));
409 RadiusTail = RadiusTail + (1-ehat)* ParsRT1+ ParsRT2/Fs *std::exp(-Tau);
418 G4double random = -ParExp1*G4RandExponential::shoot() ;
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *description)
G4GLOB_DLL std::ostream G4cout
G4double GetDensity() const
G4double GetRadlen() const
G4double GenerateRadius(G4int ispot, G4double Energy, G4double LongitudinalPosition)
~GFlashSamplingShowerParameterisation()
GFlashSamplingShowerParameterisation(G4Material *aMat1, G4Material *aMat2, G4double d1, G4double d2, GFlashSamplingShowerTuning *aPar=0)
G4double ApplySampling(const G4double DEne, const G4double Energy)
G4double IntegrateNspLongitudinal(G4double LongitudinalStep)
G4double IntegrateEneLongitudinal(G4double LongitudinalStep)
G4double GenerateExponential(G4double Energy)
G4double ComputeTau(G4double LongitudinalPosition)
void SetMaterial(G4Material *mat1, G4Material *mat2)
void GenerateLongitudinalProfile(G4double Energy)
void ComputeRadialParameters(G4double y, G4double Tau)
G4double ConstantResolution()
G4double NoiseResolution()
G4double SamplingResolution()
virtual G4double ParSigLogT1()
virtual G4double ParRT1()
virtual G4double ParRT4()
virtual G4double ParAveA1()
virtual G4double ParSigLogA2()
virtual G4double ParRC2()
virtual G4double ParWC1()
virtual G4double ParRC4()
virtual G4double ParAveT1()
virtual G4double ParSpotN2()
virtual G4double ParWC4()
virtual G4double ParRho2()
virtual G4double ParWC6()
virtual G4double ParWC3()
virtual G4double ParSpotA1()
virtual G4double ParSpotA2()
virtual G4double ParSpotT2()
virtual G4double ParRT2()
virtual G4double ParRT6()
virtual G4double ParRC3()
virtual G4double ParAveA3()
virtual G4double ParSpotT1()
virtual G4double ParSigLogT2()
virtual G4double ParWC2()
virtual G4double ParSigLogA1()
virtual G4double ParRT5()
virtual G4double ParAveA2()
virtual G4double ParSpotN1()
virtual G4double ParWC5()
virtual G4double ParRC1()
virtual G4double ParRho1()
virtual G4double ParRT3()
G4double GetEffZ(const G4Material *material)
G4double GetEffA(const G4Material *material)
G4double gam(G4double x, G4double a) const