Changeset 1449 for trunk/WuerzburgSoft/Thomas/mphys/MElectron.cc
- Timestamp:
- 07/29/02 09:10:23 (22 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/WuerzburgSoft/Thomas/mphys/MElectron.cc
r1448 r1449 129 129 const Double_t E = k[0]; 130 130 131 Double_t omega = epsilon*E/(E0*E0); 131 Double_t flim; 132 if (epsilon<1e-14) 133 { 134 const Double_t d = E/(E0*E0); 135 136 Double_t omega1 = 1e-13*d; 137 Double_t omega2 = 1e-12*d; 138 139 const Double_t f1 = Flim(&omega1); 140 const Double_t f2 = Flim(&omega2); 141 142 const Double_t m = log10(f2/f1); 143 const Double_t t = pow(f2, 13)/pow(f1, 12); 144 145 flim = pow(epsilon, m) * t; 146 } 147 else 148 { 149 Double_t omega = epsilon*E/(E0*E0); 150 flim = Flim(&omega); 151 } 132 152 133 153 const Double_t n = MParticle::Planck(&epsilon, &z)/epsilon/epsilon; // [1] 134 return Flim(&omega)*n;154 return flim*n; 135 155 } 136 156 … … 250 270 const Double_t E0 = 511e-6; //[GeV] 251 271 252 const Double_t lolim = -log10(E)/7*4-13; 253 254 TF1 fP("p_e", p_e, lolim, -10.6, 2); 255 TF1 fQ("G", G_q, 0, 1., 1); 256 272 const Double_t lolim = -log10(E)/7*4-13.5; 273 274 static TF1 fP("p_e", p_e, lolim, -10.6, 2); 275 static TF1 fQ("G", G_q, 0, 1., 1); 276 277 fP.SetNpx(50); 278 fQ.SetNpx(50); 279 280 fP.SetRange(lolim, -10.6); 257 281 fP.SetParameter(0, E); 258 282 fP.SetParameter(1, z); … … 288 312 MPhoton *MElectron::DoInvCompton(Double_t theta) 289 313 { 290 static TRandom rand(0);291 292 314 const Double_t E0 = 511e-6; //[GeV] 293 315 … … 304 326 const Double_t f = fEnergy/e; 305 327 306 Double_t t=-1 ;328 Double_t t=-10; 307 329 Double_t arg; 308 330 do 309 331 { 310 if (t> 0)332 if (t>-10) 311 333 cout << "~" << flush; 312 t = rand.Uniform(TMath::Pi())+TMath::Pi()/2; 313 Double_t er = epsilon*(gamma-gammabeta*cos(t)); // photon energy rest frame 314 arg = (f - E0/er - 1)/(sqrt(fEnergy*fEnergy-E0*E0)/e+1); 334 335 // 336 // Create an angle uniformly distributed in the range of possible 337 // interaction angles due to the known energies. 338 // 339 // The distibution is a theta-function which is incorrect, but 340 // should be correct in a first order... 341 // 342 t = gRandom->Uniform(TMath::Pi())+TMath::Pi()/2; 343 Double_t er = epsilon*(gamma-gammabeta*cos(t)); // photon energy rest frame 344 Double_t n = sqrt(fEnergy*fEnergy-E0*E0)/e+1; 345 arg = (f - E0/er - 1)/n; 346 347 /* ------------------ some hints ------------------------------ 348 -1 < arg < 1 349 -n < f - r/er - 1 < n 350 1-f-n < r/er < 1-f+n 351 r/(1-f+n) < er < r/(1-f-n) 352 r/(1-f+n) < gamma-gammabeta*cos(t) < r/(1-f-n) 353 r/(1-f+n)-gamma < -gammabeta*cos(t) < r/(1-f-n)-gamma 354 gamma-r/(1-f-n) < gammabeta*cos(t) < gamma-r/(1-f+n) 355 (gamma-r/(1-f-n))/gammabeta < cos(t) < (gamma-r/(1-f+n))/gammabeta 356 acos((gamma-r/(1-f+n))/gammabeta) < t < acos((gamma-r/(1-f-n))/gammabeta) 357 358 359 (gamma+E0/(n*arg+1-f)/epsilon)/gammabeta = cos(t); 360 1 = (epsilon/E0*cos(t)*gammabeta-gamma)*(n*arg+1-f); 361 362 arg=1: (gamma+E0/epsilon*(1-f+n))/gammabeta = cos(t); 363 arg=-1 : (gamma+E0/epsilon*(1-f-n))/gammabeta = cos(t); 364 365 (E0/(1-f-n)/epsilon+gamma)/gammabeta < cos(t) < (E0/(1-f+n)/epsilon+gamma)/gammabeta 366 */ 315 367 316 368 } while (arg<-1 || arg>1); 317 369 318 370 const Double_t theta1s = acos(arg); 319 const Double_t thetas = atan(sin(t)/(gamma*cos(t)-gammabeta));371 const Double_t thetas = atan(sin(t)/(gamma*cos(t)-gammabeta)); 320 372 321 373 const Double_t thetastar = thetas-theta1s; … … 325 377 fEnergy -= e; 326 378 327 const Double_t phi = rand.Uniform(TMath::Pi()*2); 328 379 const Double_t phi = gRandom->Uniform(TMath::Pi()*2); 380 381 /* 329 382 MPhoton &p = *new MPhoton(e, fZ); 330 383 p = *this; 384 */ 385 MPhoton &p = *new MPhoton(*this, e); 331 386 p.SetNewDirection(theta1, phi); 332 387 … … 374 429 return SetNewPosition(); 375 430 376 static TRandom rand(0); 377 Double_t x = rand.Exp(GetInteractionLength()); 431 Double_t x = gRandom->Exp(GetInteractionLength()); 378 432 379 433 // ----------------------------- … … 381 435 const Double_t E0 = 511e-6; //[GeV] 382 436 383 Double_t B_theta = rand.Uniform(TMath::Pi());384 Double_t B_phi = rand.Uniform(TMath::Pi()*2);385 386 TMatrixD M(3,3);437 Double_t B_theta = gRandom->Uniform(TMath::Pi()); 438 Double_t B_phi = gRandom->Uniform(TMath::Pi()*2); 439 440 static TMatrixD M(3,3); 387 441 388 442 M(0, 0) = sin(B_theta)*cos(B_phi); … … 398 452 M(2, 2) = 0; 399 453 400 const Double_t beta = sqrt(1 -E0/fEnergy*E0/fEnergy);454 const Double_t beta = sqrt(1.-E0/fEnergy*E0/fEnergy); 401 455 402 456 // … … 404 458 // which the x-axis is identical with the B-Field 405 459 // 406 TVectorD v(3);460 static TVectorD v(3); 407 461 v(0) = beta*sin(fTheta)*cos(fPsi); 408 462 v(1) = beta*sin(fTheta)*sin(fPsi); … … 418 472 // ----------------------------- 419 473 420 TMatrixD N(3,3);474 static TMatrixD N(3,3); 421 475 N(0, 0) = 1; 422 476 N(1, 0) = 0; … … 436 490 // v(2) = 0 437 491 // ----------------------------- 438 TVectorD p(3);492 static TVectorD p(3); 439 493 440 494 Double_t rho = 0; … … 469 523 } 470 524 471 TVectorD s(3);525 static TVectorD s(3); 472 526 s(0) = fR*cos(fPhi); 473 527 s(1) = fR*sin(fPhi); … … 494 548 // ----------------------------- 495 549 496 TVectorD w(3);550 static TVectorD w(3); 497 551 w(0) = beta_p/beta; 498 552 w(1) = beta_o/beta*cos(rho);
Note:
See TracChangeset
for help on using the changeset viewer.