Changeset 1448 for trunk/WuerzburgSoft/Thomas/mphys/phys.C
- Timestamp:
- 07/26/02 14:49:58 (22 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/WuerzburgSoft/Thomas/mphys/phys.C
r1430 r1448 33 33 Double_t PhotonSpect(Double_t *x, Double_t *k=NULL) 34 34 { 35 Double_t Ep 35 Double_t Ep = pow(10, x[0]); 36 36 37 37 Double_t res = MPhoton::Int2(&Ep, k); … … 137 137 Double_t R = MParticle::RofZ(&startz); // [kpc] 138 138 139 const char *filename = "cascade_0.03_24_1e2_1e6_256_1.root"; 140 141 const Double_t B = 0; // [T] mean magnetic field 142 143 Double_t runtime = 3.5*60*60; // [s] maximum time to run the simulation 144 145 Int_t nbins = 24; // number of bins produced in energy spectrum 146 147 Double_t lo = 1e2; // lower limit of displayed spectrum 148 Double_t hi = 1e6; // upper limit of spectrum (cutoff) 149 150 Int_t counter = 256; // maximum number of inv. Compton (-1 means infinite) 151 152 Double_t alpha = -1; // -1 means a E^2 plot 153 Double_t plot = 1; // 1 means a E^-2 spectrum 139 const char *filename = "cascade_0.03_18_1e2_1e5_B0_256_1.root"; 140 //const char *filename = "test.root"; 141 142 const Double_t B = 0;//1e-6*1e-4; // [T=1e4G] mean magnetic field 143 144 Double_t runtime = 45*60; // [s] maximum time to run the simulation 145 146 Int_t nbins = 18; // number of bins produced in energy spectrum 147 148 Double_t lo = 1e2; // lower limit of displayed spectrum 149 Double_t hi = 1e5; // upper limit of spectrum (cutoff) 150 151 Int_t counter = 256; // maximum number of inv. Compton (-1 means infinite) 152 153 Double_t alpha = -1; // -1 means a E^2 plot 154 Double_t plot = 1; // 1 means a E^-2 spectrum 155 156 Double_t bubbler = R-1e3*10; // [kpc] 157 Double_t bubblez = MParticle::ZofR(&bubbler); 154 158 155 159 // -------------------------------------------------------------------- … … 250 254 MPhoton *gamma=new MPhoton(E, startz); 251 255 gamma->SetIsPrimary(); 256 gamma->SetSrcR(R); 252 257 gamma->InitRandom(); 253 258 listg.Add(gamma); … … 304 309 // 305 310 phot.SetParameter(1, p->GetZ()); 306 307 Double_t Ep = pow(10, phot.GetRandom()); 308 if (Ep==pow(10,0)) 311 Double_t pe = phot.GetRandom(); 312 if (pe==0) 309 313 { 310 314 cout << "z" << flush; … … 312 316 } 313 317 318 Double_t Ep = pow(10, pe); 314 319 Double_t theta = RandomTheta(Eg, Ep); 315 320 if (theta==0) … … 355 360 while (test<0 ? true : (test++<counter)) 356 361 { 357 358 if (!e->SetNewPositionB(B)) 362 if (!e->SetNewPositionB(e->GetZ()>bubblez ? B : 0)) 359 363 { 360 364 cout << "!" << flush; … … 423 427 file.Write(); 424 428 429 cout << "Wrote: " << filename << endl; 425 430 cout << "Created " << n << " gammas from source with E^" << alpha << endl; 426 431 cout << "Processing time: " << Form("%.1f", (TStopwatch::GetRealTime()-starttime)/n) << " sec/gamma." << endl; … … 441 446 void phys() 442 447 { 448 /* 449 Double_t Eg = 10; 450 Double_t E0 = 511e-6; 451 Double_t z = 0.03; 452 Double_t lolim = E0*E0/Eg; 453 Double_t inf = (Eg<1e6 ? 3e-11*(z+1) : 3e-12*(z+1)); 454 if (Eg<5e4) 455 inf = 3e-11*(z+1)*pow(10, 9.4-log10(Eg)*2); 456 TF1 phot("PhotonSpectrum", PhotonSpect, log10(lolim), log10(inf), 2); 457 phot.SetParameter(0, Eg); 458 phot.SetParameter(1, z); 459 460 Double_t val[2] = {Eg,z}; 461 cout << phot.Integral(log10(lolim), log10(inf), val, 1e-2) << endl; 462 463 cout << lolim << " " << inf << endl; 464 465 phot.DrawCopy(); 466 return; 467 */ 468 443 469 DoIt(); 444 470
Note:
See TracChangeset
for help on using the changeset viewer.