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 ParRC1 = thePar->
ParRC1();
101 ParRC2 = thePar->
ParRC2();
102 ParRC3 = thePar->
ParRC3();
103 ParRC4 = thePar->
ParRC4();
105 ParWC1 = thePar->
ParWC1();
106 ParWC2 = thePar->
ParWC2();
107 ParWC3 = thePar->
ParWC3();
108 ParWC4 = thePar->
ParWC4();
109 ParWC5 = thePar->
ParWC5();
110 ParWC6 = thePar->
ParWC6();
111 ParRT1 = thePar->
ParRT1();
112 ParRT2 = thePar->
ParRT2();
113 ParRT3 = thePar->
ParRT3();
114 ParRT4 = thePar->
ParRT4();
115 ParRT5 = thePar->
ParRT5();
116 ParRT6 = thePar->
ParRT6();
147 G4cout <<
"/********************************************/ " <<
G4endl;
148 G4cout <<
" - GFlashSamplingShowerParameterisation::Constructor - " <<
G4endl;
149 G4cout <<
"/********************************************/ " <<
G4endl;
170 Ec1 = 2.66 * std::pow((X01 * Z1 / A1),1.1);
178 Ec2 = 2.66 * std::pow((X02 * Z2 / A2),1.1);
187 G4cout <<
"/************ ComputeZAX0EFFetc ************/" <<
G4endl;
188 G4cout <<
" - GFlashSamplingShowerParameterisation::Material - " <<
G4endl;
193 G4double denominator = (d1*density1 + d2*density2);
194 G4double W1 = (d1*density1) / denominator;
195 G4double W2 = (d2*density2) / denominator;
196 Zeff = ( W1*Z1 ) + ( W2*Z2 );
197 Aeff = ( W1*A1 ) + ( W2*A2 );
198 Rhoeff = ( ( d1*density1 ) + ( d2*density2 ) ) / ( d1 + d2 );
199 X0eff = (W1 * Rhoeff) / (X01 * density1) + (W2 * Rhoeff) / (X02 * density2 );
201 Rmeff = 1./ ( ( ((W1*Ec1)/X01) + ((W2*Ec2)/X02) ) / Es ) ;
202 Eceff = X0eff * ( (W1*Ec1)/X01 + (W2*Ec2)/X02 );
204 ehat = ( 1. / ( 1 + 0.007*(Z1- Z2) ) );
208 G4cout <<
"effective quantities Zeff = "<<Zeff<<
G4endl;
209 G4cout <<
"effective quantities Aeff = "<<Aeff<<
G4endl;
210 G4cout <<
"effective quantities Rhoeff = "<<Rhoeff/g *cm3<<
" g/cm3" <<
G4endl;
211 G4cout <<
"effective quantities X0eff = "<<X0eff/cm <<
" cm" <<
G4endl;
213 X0eff = X0eff * Rhoeff;
215 G4cout <<
"effective quantities X0eff = "<<X0eff/g*cm2 <<
" g/cm2" <<
G4endl;
216 X0eff = X0eff /Rhoeff;
217 G4cout <<
"effective quantities RMeff = "<<Rmeff/cm<<
" cm" <<
G4endl;
218 Rmeff = Rmeff* Rhoeff;
219 G4cout <<
"effective quantities RMeff = "<<Rmeff/g *cm2<<
" g/cm2" <<
G4endl;
220 Rmeff = Rmeff/ Rhoeff;
221 G4cout <<
"effective quantities Eceff = "<<Eceff/MeV<<
" MeV"<<
G4endl;
224 G4cout <<
"/********************************************/ " <<
G4endl;
232 if ((material1==0) || (material2 ==0))
234 G4Exception(
"GFlashSamplingShowerParameterisation::GenerateLongitudinalProfile()",
238 ComputeLongitudinalParameters(y);
239 GenerateEnergyProfile(y);
240 GenerateNSpotProfile(y);
246GFlashSamplingShowerParameterisation::ComputeLongitudinalParameters(
G4double y)
248 AveLogTmaxh = std::log( std::max( ParAveT1 + std::log(y), 0.1 ) );
249 AveLogAlphah = std::log( std::max( ParAveA1 + (ParAveA2+ParAveA3/Zeff)*std::log(y), 0.1 ) );
251 SigmaLogTmaxh = std::min( 0.5, 1.00/( ParSigLogT1 + ParSigLogT2*std::log(y) ) );
252 SigmaLogAlphah = std::min( 0.5, 1.00/( ParSigLogA1 + ParSigLogA2*std::log(y) ) );
253 Rhoh = ParRho1 + ParRho2*std::log(y);
255 AveLogTmax = std::max( 0.1, std::log(std::exp(AveLogTmaxh) + ParsAveT1/Fs + ParsAveT2*(1-ehat)) );
256 AveLogAlpha = std::max( 0.1, std::log(std::exp(AveLogAlphah) + ParsAveA1/Fs) );
258 SigmaLogTmax = std::min( 0.5, 1.00 / (ParsSigLogT1 + ParsSigLogT2*std::log(y)) );
259 SigmaLogAlpha = std::min( 0.5, 1.00 / (ParsSigLogA1 + ParsSigLogA2*std::log(y)) );
260 Rho = ParsRho1 + ParsRho2*std::log(y);
265 G4cout <<
" std::log(std::exp(AveLogTmaxh) + ParsAveT1/Fs + ParsAveT2*(1-ehat)) = "
266 <<
" std::log(" << std::exp(AveLogTmaxh) <<
" + " << ParsAveT1/Fs <<
" + " << ParsAveT2*(1-ehat) <<
") = "
267 <<
" std::log(" << std::exp(AveLogTmaxh) <<
" + " << ParsAveT1 <<
"/" << Fs <<
" + " << ParsAveT2 <<
"*" << (1-ehat) <<
") = "
268 <<
" std::log(" << std::exp(AveLogTmaxh) + ParsAveT1/Fs + ParsAveT2*(1-ehat) <<
")" <<
G4endl;
272 G4cout <<
" 1.00/( ParSigLogT1 + ParSigLogT2*std::log(y) ) = " << 1.00 <<
"/" << ( ParSigLogT1 + ParSigLogT2*std::log(y) ) <<
" = "
273 << 1.00 <<
"/" <<
"(" << ParSigLogT1 <<
" + " << ParSigLogT2*std::log(y) <<
" ) = "
274 << 1.00 <<
"/" <<
"(" << ParSigLogT1 <<
" + " << ParSigLogT2 <<
"*" << std::log(y) <<
" ) "
276 G4cout <<
" SigmaLogAlphah " << SigmaLogAlphah <<
G4endl;
288void GFlashSamplingShowerParameterisation::GenerateEnergyProfile(
G4double )
290 G4double Correlation1 = std::sqrt( (1+Rho )/2 );
291 G4double Correlation2 = std::sqrt( (1-Rho )/2 );
292 G4double Correlation1h = std::sqrt( (1+Rhoh)/2 );
293 G4double Correlation2h = std::sqrt( (1-Rhoh)/2 );
294 G4double Random1 = G4RandGauss::shoot();
295 G4double Random2 = G4RandGauss::shoot();
297 Tmax = std::max( 1., std::exp( AveLogTmax + SigmaLogTmax * (Correlation1*Random1 + Correlation2*Random2) ) );
298 Alpha = std::max( 1.1, std::exp( AveLogAlpha + SigmaLogAlpha * (Correlation1*Random1 - Correlation2*Random2) ) );
299 Beta = (Alpha-1.00)/Tmax;
301 Tmaxh = std::exp( AveLogTmaxh + SigmaLogTmaxh *
302 (Correlation1h*Random1 + Correlation2h*Random2) );
303 Alphah = std::exp( AveLogAlphah + SigmaLogAlphah *
304 (Correlation1h*Random1 - Correlation2h*Random2) );
305 Betah = (Alphah-1.00)/Tmaxh;
310void GFlashSamplingShowerParameterisation::GenerateNSpotProfile(
const G4double y)
312 TNSpot = Tmaxh * (ParsSpotT1+ParsSpotT2*Zeff);
313 TNSpot = std::max(0.5,Tmaxh * (ParsSpotT1+ParsSpotT2*Zeff));
314 AlphaNSpot = Alphah * (ParsSpotA1+ParsSpotA2*Zeff);
315 BetaNSpot = (AlphaNSpot-1.00)/TNSpot;
316 NSpot = ParsSpotN1 /SamplingResolution * std::pow(y*Eceff/GeV,ParsSpotN2 );
326 G4double Resolution = std::pow(SamplingResolution,2);
333 if(Resolution >0.0 && DEne > 0.00)
336 G4float x2 = G4RandGamma::shoot(x1, 1.0)*Resolution;
339 return DEneFluctuated;
347 G4double LongitudinalStepInX0 = LongitudinalStep / X0eff;
348 G4float x1= Betah*LongitudinalStepInX0;
350 float x3 =
gam(x1,x2);
360 G4double LongitudinalStepInX0 = LongitudinalStep / X0eff;
361 G4float x1 = BetaNSpot*LongitudinalStepInX0;
385 if(Random1 <WeightCore)
387 Radius = Rmeff * RadiusCore * std::sqrt( Random2/(1. - Random2) );
391 Radius = Rmeff * RadiusTail * std::sqrt( Random2/(1. - Random2) );
393 Radius = std::min(Radius,
DBL_MAX);
403 G4double tau = LongitudinalPosition / Tmax/ X0eff
404 * (Alpha-1.00) /Alpha
405 * std::exp(AveLogAlpha)/(std::exp(AveLogAlpha)-1.);
414 G4double z1 = ParRC1 + ParRC2* std::log(Energy/GeV);
416 RadiusCore = z1 + z2 * Tau;
419 G4double p3 = ParWC5+ParWC6*std::log(Energy/GeV);
420 WeightCore = p1 * std::exp( (p2-Tau)/p3- std::exp( (p2-Tau) /p3) );
425 G4double k4 = ParRT5+ParRT6* std::log(Energy/GeV);
427 RadiusTail = k1*(std::exp(k3*(Tau-k2))
428 + std::exp(k4*(Tau-k2)) );
432 RadiusCore = RadiusCore + ParsRC1*(1-ehat) + ParsRC2/Fs*std::exp(-Tau);
433 WeightCore = WeightCore + (1-ehat)
434 * (ParsWC1+ParsWC2/Fs * std::exp(-std::pow((Tau-1.),2)));
435 RadiusTail = RadiusTail + (1-ehat)* ParsRT1+ ParsRT2/Fs *std::exp(-Tau);
444 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 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 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