89 ParAveT1 = thePar->ParAveT1();
90 ParAveA1 = thePar->ParAveA1();
91 ParAveA2 = thePar->ParAveA2();
92 ParAveA3 = thePar->ParAveA3();
97 ParSigLogT2 = thePar->ParsSigLogT2();
102 ParSigLogA2 = thePar->ParSigLogA2();
104 ParRho1 = thePar->ParRho1();
105 ParRho2 = thePar->ParRho2();
107 ParsAveT1 = thePar->ParsAveT1();
108 ParsAveT2 = thePar->ParsAveT2();
109 ParsAveA1 = thePar->ParsAveA1();
111 ParsSigLogT1 = thePar->ParsSigLogT1();
113 ParsSigLogT2 = thePar->ParsSigLogT2();
115 ParsSigLogA1 = thePar->ParsSigLogA1();
117 ParsSigLogA2 = thePar->ParsSigLogA2();
121 ParsRho2 = thePar->ParsRho2();
126 ParRC1 = thePar->ParRC1();
127 ParRC2 = thePar->ParRC2();
128 ParRC3 = thePar->ParRC3();
129 ParRC4 = thePar->ParRC4();
131 ParWC1 = thePar->ParWC1();
132 ParWC2 = thePar->ParWC2();
133 ParWC3 = thePar->ParWC3();
134 ParWC4 = thePar->ParWC4();
135 ParWC5 = thePar->ParWC5();
136 ParWC6 = thePar->ParWC6();
137 ParRT1 = thePar->ParRT1();
138 ParRT2 = thePar->ParRT2();
139 ParRT3 = thePar->ParRT3();
140 ParRT4 = thePar->ParRT4();
141 ParRT5 = thePar->ParRT5();
142 ParRT6 = thePar->ParRT6();
145 ParsRC1 = thePar->ParsRC1();
146 ParsRC2 = thePar->ParsRC2();
147 ParsWC1 = thePar->ParsWC1();
148 ParsWC2 = thePar->ParsWC2();
149 ParsRT1 = thePar->ParsRT1();
150 ParsRT2 = thePar->ParsRT2();
153 ParsSpotT1 = thePar->ParSpotT1();
154 ParsSpotT2 = thePar->ParSpotT2();
155 ParsSpotA1 = thePar->ParSpotA1();
156 ParsSpotA2 = thePar->ParSpotA2();
157 ParsSpotN1 = thePar->ParSpotN1();
158 ParsSpotN2 = thePar->ParSpotN2();
159 SamplingResolution = thePar->SamplingResolution();
160 ConstantResolution = thePar->ConstantResolution();
161 NoiseResolution = thePar->NoiseResolution();
173 G4cout <<
"/********************************************/ " <<
G4endl;
174 G4cout <<
" - GFlashSamplingShowerParameterisation::Constructor - " <<
G4endl;
175 G4cout <<
"/********************************************/ " <<
G4endl;
193 density1 = material1->GetDensity();
194 X01 = material1->GetRadlen();
195 Ec1 = 2.66 * std::pow((X01 * Z1 / A1), 1.1);
197 Rm1 = X01 * Es / Ec1;
202 density2 = material2->GetDensity();
203 X02 = material2->GetRadlen();
204 Ec2 = 2.66 * std::pow((X02 * Z2 / A2), 1.1);
206 Rm2 = X02 * Es / Ec2;
214 G4cout <<
"/************ ComputeZAX0EFFetc ************/" <<
G4endl;
215 G4cout <<
" - GFlashSamplingShowerParameterisation::Material - " <<
G4endl;
220 G4double denominator = (d1 * density1 + d2 * density2);
221 G4double W1 = (d1 * density1) / denominator;
222 G4double W2 = (d2 * density2) / denominator;
223 Zeff = (W1 * Z1) + (W2 * Z2);
224 Aeff = (W1 * A1) + (W2 * A2);
225 Rhoeff = ((d1 * density1) + (d2 * density2)) / (d1 + d2);
226 X0eff = (W1 * Rhoeff) / (X01 * density1) + (W2 * Rhoeff) / (X02 * density2);
228 Rmeff = 1. / ((((W1 * Ec1) / X01) + ((W2 * Ec2) / X02)) / Es);
229 Eceff = X0eff * ((W1 * Ec1) / X01 + (W2 * Ec2) / X02);
230 Fs = X0eff / (d1 + d2);
232 ehat = (1. / (1 + 0.007 * (Z1 - Z2)));
236 G4cout <<
"effective quantities Zeff = " << Zeff <<
G4endl;
237 G4cout <<
"effective quantities Aeff = " << Aeff <<
G4endl;
238 G4cout <<
"effective quantities Rhoeff = " << Rhoeff / g * cm3 <<
" g/cm3" <<
G4endl;
239 G4cout <<
"effective quantities X0eff = " << X0eff / cm <<
" cm" <<
G4endl;
241 X0eff = X0eff * Rhoeff;
243 G4cout <<
"effective quantities X0eff = " << X0eff / g * cm2 <<
" g/cm2" <<
G4endl;
244 X0eff = X0eff / Rhoeff;
245 G4cout <<
"effective quantities RMeff = " << Rmeff / cm <<
" cm" <<
G4endl;
246 Rmeff = Rmeff * Rhoeff;
247 G4cout <<
"effective quantities RMeff = " << Rmeff / g * cm2 <<
" g/cm2" <<
G4endl;
248 Rmeff = Rmeff / Rhoeff;
249 G4cout <<
"effective quantities Eceff = " << Eceff / MeV <<
" MeV" <<
G4endl;
251 G4cout <<
"effective quantities ehat = " << ehat <<
G4endl;
252 G4cout <<
"/********************************************/ " <<
G4endl;
259 if ((material1 == 0) || (material2 == 0)) {
260 G4Exception(
"GFlashSamplingShowerParameterisation::GenerateLongitudinalProfile()",
264 ComputeLongitudinalParameters(y);
265 GenerateEnergyProfile(y);
266 GenerateNSpotProfile(y);
271void GFlashSamplingShowerParameterisation::ComputeLongitudinalParameters(
G4double y)
273 AveLogTmaxh = std::log(std::max(ParAveT1 + std::log(y), 0.1));
275 std::log(std::max(ParAveA1 + (ParAveA2 + ParAveA3 / Zeff) * std::log(y), 0.1));
277 SigmaLogTmaxh = std::min(0.5, 1.00 / (ParSigLogT1 + ParSigLogT2 * std::log(y)));
278 SigmaLogAlphah = std::min(0.5, 1.00 / (ParSigLogA1 + ParSigLogA2 * std::log(y)));
279 Rhoh = ParRho1 + ParRho2 * std::log(y);
282 std::max(0.1, std::log(std::exp(AveLogTmaxh) + ParsAveT1 / Fs + ParsAveT2 * (1 - ehat)));
283 AveLogAlpha = std::max(0.1, std::log(std::exp(AveLogAlphah) + ParsAveA1 / Fs));
285 SigmaLogTmax = std::min(0.5, 1.00 / (ParsSigLogT1 + ParsSigLogT2 * std::log(y)));
286 SigmaLogAlpha = std::min(0.5, 1.00 / (ParsSigLogA1 + ParsSigLogA2 * std::log(y)));
287 Rho = ParsRho1 + ParsRho2 * std::log(y);
291 G4cout <<
" std::log(std::exp(AveLogTmaxh) + ParsAveT1/Fs + ParsAveT2*(1-ehat)) = "
292 <<
" std::log(" << std::exp(AveLogTmaxh) <<
" + " << ParsAveT1 / Fs <<
" + "
293 << ParsAveT2 * (1 - ehat) <<
") = "
294 <<
" std::log(" << std::exp(AveLogTmaxh) <<
" + " << ParsAveT1 <<
"/" << Fs <<
" + "
295 << ParsAveT2 <<
"*" << (1 - ehat) <<
") = "
296 <<
" std::log(" << std::exp(AveLogTmaxh) + ParsAveT1 / Fs + ParsAveT2 * (1 - ehat) <<
")"
301 G4cout <<
" 1.00/( ParSigLogT1 + ParSigLogT2*std::log(y) ) = " << 1.00 <<
"/"
302 << (ParSigLogT1 + ParSigLogT2 * std::log(y)) <<
" = " << 1.00 <<
"/" <<
"("
303 << ParSigLogT1 <<
" + " << ParSigLogT2 * std::log(y) <<
" ) = " << 1.00 <<
"/" <<
"("
304 << ParSigLogT1 <<
" + " << ParSigLogT2 <<
"*" << std::log(y) <<
" ) " <<
G4endl;
305 G4cout <<
" SigmaLogAlphah " << SigmaLogAlphah <<
G4endl;
317void GFlashSamplingShowerParameterisation::GenerateEnergyProfile(
G4double )
319 G4double Correlation1 = std::sqrt((1 + Rho) / 2);
320 G4double Correlation2 = std::sqrt((1 - Rho) / 2);
321 G4double Correlation1h = std::sqrt((1 + Rhoh) / 2);
322 G4double Correlation2h = std::sqrt((1 - Rhoh) / 2);
323 G4double Random1 = G4RandGauss::shoot();
324 G4double Random2 = G4RandGauss::shoot();
327 1., std::exp(AveLogTmax + SigmaLogTmax * (Correlation1 * Random1 + Correlation2 * Random2)));
329 1.1, std::exp(AveLogAlpha + SigmaLogAlpha * (Correlation1 * Random1 - Correlation2 * Random2)));
330 Beta = (Alpha - 1.00) / Tmax;
333 std::exp(AveLogTmaxh + SigmaLogTmaxh * (Correlation1h * Random1 + Correlation2h * Random2));
335 std::exp(AveLogAlphah + SigmaLogAlphah * (Correlation1h * Random1 - Correlation2h * Random2));
336 Betah = (Alphah - 1.00) / Tmaxh;
341void GFlashSamplingShowerParameterisation::GenerateNSpotProfile(
const G4double y)
343 TNSpot = Tmaxh * (ParsSpotT1 + ParsSpotT2 * Zeff);
344 TNSpot = std::max(0.5, Tmaxh * (ParsSpotT1 + ParsSpotT2 * Zeff));
345 AlphaNSpot = Alphah * (ParsSpotA1 + ParsSpotA2 * Zeff);
346 BetaNSpot = (AlphaNSpot - 1.00) / TNSpot;
347 NSpot = ParsSpotN1 / SamplingResolution * std::pow(y * Eceff / GeV, ParsSpotN2);
355 G4double Resolution = std::pow(SamplingResolution, 2);
362 if (Resolution > 0.0 && DEne > 0.00) {
368 DEneFluctuated = G4RandGamma::shoot(x1, x2);
370 return DEneFluctuated;
378 G4double LongitudinalStepInX0 = LongitudinalStep / X0eff;
379 G4float x1= Betah*LongitudinalStepInX0;
381 float x3 =
gam(x1,x2);
390 G4double LongitudinalStepInX0 = LongitudinalStep / X0eff;
391 G4float x1 = BetaNSpot * LongitudinalStepInX0;
414 if (Random1 < WeightCore)
416 Radius = Rmeff * RadiusCore * std::sqrt(Random2 / (1. - Random2));
419 Radius = Rmeff * RadiusTail * std::sqrt(Random2 / (1. - Random2));
421 Radius = std::min(Radius,
DBL_MAX);
429 G4double tau = LongitudinalPosition / Tmax / X0eff
430 * (Alpha - 1.00) / Alpha * std::exp(AveLogAlpha)
431 / (std::exp(AveLogAlpha) - 1.);
439 G4double z1 = ParRC1 + ParRC2 * std::log(Energy / GeV);
440 G4double z2 = ParRC3 + ParRC4 * Zeff;
441 RadiusCore = z1 + z2 * Tau;
442 G4double p1 = ParWC1 + ParWC2 * Zeff;
443 G4double p2 = ParWC3 + ParWC4 * Zeff;
444 G4double p3 = ParWC5 + ParWC6 * std::log(Energy / GeV);
445 WeightCore = p1 * std::exp((p2 - Tau) / p3 - std::exp((p2 - Tau) / p3));
447 G4double k1 = ParRT1 + ParRT2 * Zeff;
450 G4double k4 = ParRT5 + ParRT6 * std::log(Energy / GeV);
452 RadiusTail = k1 * (std::exp(k3 * (Tau - k2)) + std::exp(k4 * (Tau - k2)));
456 RadiusCore = RadiusCore + ParsRC1 * (1 - ehat) + ParsRC2 / Fs * std::exp(-Tau);
458 WeightCore + (1 - ehat) * (ParsWC1 + ParsWC2 / Fs * std::exp(-std::pow((Tau - 1.), 2)));
459 RadiusTail = RadiusTail + (1 - ehat) * ParsRT1 + ParsRT2 / Fs * std::exp(-Tau);
468 G4double random = -ParExp1*G4RandExponential::shoot() ;
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *description)
G4GLOB_DLL std::ostream G4cout
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 GetEffZ(const G4Material *material)
G4double GetEffA(const G4Material *material)
GVFlashShowerParameterisation()
G4double gam(G4double x, G4double a) const