Changeset 1429
- Timestamp:
- 07/24/02 09:32:37 (22 years ago)
- Location:
- trunk/WuerzburgSoft/Thomas/mphys
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/WuerzburgSoft/Thomas/mphys/Changelog
r1375 r1429 1 1 -*-*- END -*-*- 2 2002/06/21: Thomas Bretz 3 4 * MElectron.cc: 5 - changed upper limit in InteractionLength from 1e-11 to 2e-11 6 - changed upper limit of p_e in EnergyLoss from -10.8 to -10.6 7 8 * MParticle.[h,cc]: 9 - replaced Planck by tanjas background 10 11 * background.txt: 12 - added 13 14 * MPhoton.[h,cc]: 15 - changed lower limit of Int2-Integration for Interaction Length 16 in case Eg<5e4 to fit better its needs 17 - changed max/min of drawing interaction length 18 - changed lower limit of interaction length plot 19 20 * analp.C: 21 - added plotting 1h1426 data 22 - changed alpha/plot from -2/2 to -1/1 (which means I do the well 23 known E^2 plot of an E^-2 spectrum) 24 - added a cutoff to simulate cutoff spectra 25 - some small corrections for the layout of the plots 26 27 * phys.C: 28 - added a maximum number of inv. Compton processes 29 - don't throw away photons which were reemitted lower than the lower 30 limit of the plot (so they are still written to the file) 31 - changed the lower limit of the PhotonSpect simulation function 32 to a physically more realistic value. No photon which don't have 33 an corresponding angle are produced anymore. 34 - stop the electron only if its energy is less than a thousand 35 of its primary energy 36 37 38 2 39 2002/06/21: Thomas Bretz 3 40 -
trunk/WuerzburgSoft/Thomas/mphys/phys.C
r1374 r1429 34 34 { 35 35 Double_t Ep = pow(10, x[0]); 36 36 37 Double_t res = MPhoton::Int2(&Ep, k); 37 38 38 return res*1e55; //65/k[0]; 39 // return MPhoton::Planck(&Ep, &k[1]); 39 40 //return MPhoton::Planck(&Ep, &k[1]); 40 41 } 41 42 … … 119 120 void DoIt() 120 121 { 121 Double_t R = 100; //MParticle::RofZ(&startz); // [kpc] 122 Double_t startz = MParticle::ZofR(&R); 123 124 const char *filename = "cascade_delme.root"; 125 126 const Double_t B = 0; 122 // a --> 5 123 // b --> 10 124 // c --> 2 125 126 // delme, delmeB starting integration at lolim 127 // delme2, delme2B starting integration at -log10(Eg)-8 128 // delme3, lolim, 24, 1e2-1e6, 2x inv.Compton 129 // delme3B, lolim, 24, 1e2-1e6, 4x inv.Compton 130 // delme3C, lolim, 24, 1e2-1e6, 8x inv.Compton 131 // delme3D, lolim, 24, 1e2-1e6, 16x inv.Compton 132 // delme3E, lolim, 24, 1e2-1e6, 32x inv.Compton 133 134 // delme3H, lolim, 24, 1e2-1e6, 256x inv.Compton 8*60 135 136 Double_t startz = 0.03; //MParticle::ZofR(&R); 137 Double_t R = MParticle::RofZ(&startz); // [kpc] 138 139 const char *filename = "delme3H.root"; 140 141 const Double_t B = 0; // [T] mean magnetic field 142 143 Double_t runtime = 8*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 154 155 // -------------------------------------------------------------------- 127 156 128 157 cout << "R = " << R << "kpc" << endl; … … 131 160 MPairProduction pair; 132 161 133 Double_t runtime = 5*60; // [s]134 135 Double_t lo = 1e4;136 Double_t hi = 1e11;137 Double_t alpha = -2;138 Double_t plot = 2;139 140 Int_t nbins = 21; //4*log10(hi/lo);141 142 162 TH1D hist; 143 163 TH1D histsrc; 144 164 145 hist.SetMinimum(pow(lo, plot+alpha)/10 );146 histsrc.SetMinimum(pow(lo, plot+alpha)/10 );165 hist.SetMinimum(pow(lo, plot+alpha)/100); 166 histsrc.SetMinimum(pow(lo, plot+alpha)/100); 147 167 148 168 TList listg; … … 230 250 { 231 251 if (listg.GetSize()!=0) 232 cout << " |P :" << flush;252 cout << " |P" << flush; 233 253 234 254 TIter NextP(&listg); … … 237 257 while ((p=(MPhoton*)NextP())) 238 258 { 259 cout << ":" << flush; 239 260 Double_t Eg = p->GetEnergy(); 240 261 241 if (!p->SetNewPosition()) 262 Double_t E0 = 511e-6; 263 Double_t z = p->GetZ(); 264 Double_t lolim = E0*E0/Eg; 265 Double_t inf = (Eg<1e6 ? 3e-11*(z+1) : 3e-12*(z+1)); 266 if (Eg<5e4) 267 inf = 3e-11*(z+1)*pow(10, 9.4-log10(Eg)*2); 268 269 //TF1 phot("PhotonSpectrum", PhotonSpect, -log10(Eg)-8, -10.5, 2); 270 //Double_t E0 = 511e-6; // [GeV] 271 TF1 phot("PhotonSpectrum", PhotonSpect, log10(lolim), log10(inf), 2); 272 phot.SetParameter(0, Eg); 273 while (1) 242 274 { 243 cout << "!" << flush; 244 245 hist.Fill(Eg, pow(Eg, plot)*weight); 246 247 p->SetIsPrimary(kFALSE); 248 T1->Fill(); 249 250 Esum += Eg; 251 252 delete listg.Remove(p); 253 continue; 275 if (!p->SetNewPosition()) 276 { 277 cout << "!" << flush; 278 279 hist.Fill(Eg, pow(Eg, plot)*weight); 280 281 p->SetIsPrimary(kFALSE); 282 T1->Fill(); 283 284 Esum += Eg; 285 286 break; 287 } 288 289 // 290 // Sample phtoton from background and interaction angle 291 // 292 phot.SetParameter(1, p->GetZ()); 293 294 Double_t Ep = pow(10, phot.GetRandom()); 295 if (Ep==pow(10,0)) 296 { 297 cout << "z" << flush; 298 continue; 299 } 300 301 Double_t theta = RandomTheta(Eg, Ep); 302 if (theta==0) 303 { 304 cout << "t" << flush; 305 continue; 306 } 307 308 if (!pair.Process(p, Ep, theta, &liste)) 309 { 310 cout << "0" << flush; 311 continue; 312 } 313 314 cout << "." << flush; 315 break; 254 316 } 255 256 //257 // Sample phtoton from background and interaction angle258 //259 TF1 phot("PhotonSpectrum", PhotonSpect, -log10(Eg)-8, -10.5, 2);260 phot.SetParameter(0, Eg);261 phot.SetParameter(1, p->GetZ());262 263 Double_t Ep = pow(10, phot.GetRandom());264 if (Ep==pow(10,0))265 {266 cout << "z" << flush;267 continue;268 }269 Double_t theta = RandomTheta(Eg, Ep);270 if (theta==0)271 {272 cout << "t" << flush;273 continue;274 }275 276 if (!pair.Process(p, Ep, theta, &liste))277 {278 cout << "0" << flush;279 continue;280 }281 282 317 delete listg.Remove(p); 283 cout << "." << flush;284 318 } 285 319 … … 299 333 e->SetIsPrimary(kFALSE); 300 334 301 if (e->GetEnergy()<lo) 335 Double_t Ee = e->GetEnergy(); 336 337 if (Ee<lo) 302 338 continue; 303 339 304 340 cout << ":" << flush; 305 while(1) 341 int test = counter<0 ? -1 : counter; 342 while (test<0 ? true : (test++<256)) 306 343 { 344 307 345 if (!e->SetNewPositionB(B)) 308 346 { … … 316 354 T2->Fill(); 317 355 356 cout << "." << flush; 357 listg.Add(p); 358 /* 318 359 if (fabs(p->GetTheta()*3437)<60 && // < 60min 319 360 p->GetEnergy()>lo) … … 324 365 else 325 366 { 326 if (p->GetEnergy()< =lo)367 if (p->GetEnergy()<E*pow(10, alpha)/5 || p->GetEnergy()<=lo) 327 368 cout << "e" << flush; 328 369 else … … 332 373 Emis += p->GetEnergy(); 333 374 } 334 375 */ 335 376 if (fabs(e->GetTheta()*3437)>60) // < 60min 336 377 { … … 339 380 } 340 381 341 if (e->GetEnergy()< lo)//*5)382 if (e->GetEnergy()<Ee*1e-3) // <2e3 342 383 { 343 384 cout << "E" << flush;
Note:
See TracChangeset
for help on using the changeset viewer.