Ignore:
Timestamp:
07/26/02 14:49:58 (22 years ago)
Author:
tbretz
Message:
*** empty log message ***
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/WuerzburgSoft/Thomas/mphys/phys.C

    r1430 r1448  
    3333Double_t PhotonSpect(Double_t *x, Double_t *k=NULL)
    3434{
    35     Double_t Ep  = pow(10, x[0]);
     35    Double_t Ep = pow(10, x[0]);
    3636
    3737    Double_t res = MPhoton::Int2(&Ep, k);
     
    137137    Double_t R      = MParticle::RofZ(&startz); // [kpc]
    138138
    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);
    154158
    155159    // --------------------------------------------------------------------
     
    250254        MPhoton *gamma=new MPhoton(E, startz);
    251255        gamma->SetIsPrimary();
     256        gamma->SetSrcR(R);
    252257        gamma->InitRandom();
    253258        listg.Add(gamma);
     
    304309                    //
    305310                    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)
    309313                    {
    310314                        cout << "z" << flush;
     
    312316                    }
    313317
     318                    Double_t Ep = pow(10, pe);
    314319                    Double_t theta = RandomTheta(Eg, Ep);
    315320                    if (theta==0)
     
    355360                while (test<0 ? true : (test++<counter))
    356361                {
    357 
    358                     if (!e->SetNewPositionB(B))
     362                    if (!e->SetNewPositionB(e->GetZ()>bubblez ? B : 0))
    359363                    {
    360364                        cout << "!" << flush;
     
    423427    file.Write();
    424428
     429    cout << "Wrote: " << filename << endl;
    425430    cout << "Created " << n << " gammas from source with E^" << alpha << endl;
    426431    cout << "Processing time: " << Form("%.1f", (TStopwatch::GetRealTime()-starttime)/n) << " sec/gamma." << endl;
     
    441446void phys()
    442447{
     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
    443469    DoIt();
    444470
Note: See TracChangeset for help on using the changeset viewer.