Changeset 1367


Ignore:
Timestamp:
06/14/02 10:41:23 (22 years ago)
Author:
tbretz
Message:
*** empty log message ***
Location:
trunk/WuerzburgSoft/Thomas/mphys
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/WuerzburgSoft/Thomas/mphys/Changelog

    r1364 r1367  
    88     - changed the eps of all integrals to 1e-2
    99     - changed the p_e function to use the Compton function
     10     - made all function which are used for integration only static
     11       and changed the function definition from=0, to=0
    1012
    1113   * MPhoton.[h,cc]:
     
    2527   * phys.C:
    2628     - changed the integral eps to 1e-2
     29     - small changed to the output
     30     - removed integral==0, replaced by Ep==pow(10,0)
    2731     
    2832
  • trunk/WuerzburgSoft/Thomas/mphys/MElectron.cc

    r1364 r1367  
    9090        return DiSum(x);
    9191
    92     TF1 IntLi("Li", Li, 0, z, 0);
     92    // TF1 IntLi("Li", Li, 0, z, 0);
     93    static TF1 IntLi("Li", Li, 0, 0, 0);
    9394    const Double_t integ = IntLi.Integral(0, z, (Double_t*)NULL, 1e-2);
    9495    return -integ;
     
    160161    const Double_t z      = k ? k[0] : 0;
    161162
    162     Double_t val[3] = { E[0], z };                         // E[GeV]
    163 
    164     const Double_t from   = 1e-17;
    165     const Double_t to     = 1e-11;
    166 
    167163    /* -------------- old ----------------
    168164       Double_t from   = 1e-15;
     
    171167       -----------------------------------
    172168    */
    173     TF1 func("Compton", Compton, from, to, 2);            // [0, inf]
     169    static TF1 func("Compton", Compton, 0, 0, 2);         // [0, inf]
     170
     171    const Double_t from   = 1e-17;
     172    const Double_t to     = 1e-11;
     173
     174    Double_t val[3] = { E[0], z };                        // E[GeV]
    174175
    175176    Double_t integ  = func.Integral(from, to, val, 1e-2); // [Gev] [0, inf]
     
    260261    const Double_t Gamma = 4.*omega;
    261262
    262     // --old-- fQ.SetRange(1e-6, 1./(1.+ 2.*Gamma));
    263263    fQ.SetParameter(0, Gamma);
    264264
  • trunk/WuerzburgSoft/Thomas/mphys/MPairProduction.cc

    r1363 r1367  
    1616!
    1717!
    18 !   Author(s): Harald Kornmayer 1/2001 (harald@mppmu.mpg.de)
    19 !   Author(s): Thomas Bretz  12/2000 (tbretz@uni-sw.gwdg.de)
     18!   Author(s): Thomas Bretz  12/2000 <mailto:tbretz@astro.uni-wuerzburg.de>
    2019!
    21 !   Copyright: MAGIC Software Development, 2000-2001
     20!   Copyright: MAGIC Software Development, 2000-2002
    2221!
    2322!
  • trunk/WuerzburgSoft/Thomas/mphys/MPhoton.cc

    r1364 r1367  
    9292    Double_t val[2] = { Eg, Ep };
    9393
    94     const Double_t from = -1.0;
    95     const Double_t to   = 1.-E0*E0/(2.*Eg*Ep); // Originally Was: 1.
     94    static TF1 f("int1", Int1, 0, 0, 2);
    9695
    97     TF1 f("int1", Int1, from, to, 2);
    98 
     96    const Double_t from   = -1.0;
     97    const Double_t to     = 1.-E0*E0/(2.*Eg*Ep);              // Originally Was: 1.
    9998    const Double_t int1   = f.Integral(from, to, val, 1e-2);  // [m^2]
    100     const Double_t planck = MParticle::Planck(&Ep, &z); // [GeV^2]
     99    const Double_t planck = MParticle::Planck(&Ep, &z);       // [GeV^2]
    101100
    102101    const Double_t res = planck * int1;
     
    124123    Double_t val[2] = { Eg, z };
    125124
     125    static TF1 f("int2", Int2, 0, 0, 2);
     126
    126127    Double_t lolim = E0*E0/Eg;
    127128    Double_t inf   = Eg<1e6 ? 3e-11*(z+1) : 3e-12*(z+1);
    128 
    129     TF1 f("int2", Int2, lolim, inf, 2);
    130 
    131     Double_t int2 = f.Integral(lolim, inf, val, 1e-2); //[GeV^3 m^2]
     129    Double_t int2  = f.Integral(lolim, inf, val, 1e-2); //[GeV^3 m^2]
    132130
    133131    if (int2==0)
  • trunk/WuerzburgSoft/Thomas/mphys/phys.C

    r1366 r1367  
    6161    TF1 func("RndTheta", Sbar_sigmas, 0, log10(f), 0);
    6262
     63    func.SetNpx(50);
     64
    6365    Double_t sbar  = pow(10, func.GetRandom());
    6466    Double_t theta = acos(1.-sbar*2/f);
     
    116118void DoIt()
    117119{
    118     Double_t startz = 0.003;                   //MParticle::ZofR(&R);
    119     Double_t R      = MParticle::RofZ(&startz); // [kpc]
     120    Double_t R      = 100; //MParticle::RofZ(&startz); // [kpc]
     121    Double_t startz = MParticle::ZofR(&R);
    120122
    121123    cout << "R = " << R << "kpc" << endl;
     
    127129    Double_t runtime = 15*60; // [s]
    128130
    129     Double_t lo = 1e4; 
     131    Double_t lo = 1e4;
    130132    Double_t hi = 1e11;
    131133    Double_t alpha = -2;
     
    274276                phot.SetParameter(0, Eg);
    275277                phot.SetParameter(1, p->GetZ());
     278                /*
    276279                if (phot.Integral(-log10(Eg)-8, -10.5, (Double_t*)NULL, 1e-2)==0)
    277280                {
     
    279282                    continue;
    280283                }
    281 
     284                */
    282285                Double_t Ep    = pow(10, phot.GetRandom());
     286                if (Ep==pow(10,0))
     287                {
     288                    cout << "z" << flush;
     289                    continue;
     290                }
    283291                Double_t theta = RandomTheta(Eg, Ep);
    284292                if (theta==0)
     
    339347                    else
    340348                    {
    341                         cout << "i" << flush; // ignored
     349                        if (p->GetEnergy()<=lo)
     350                            cout << "e" << flush;
     351                        else
     352                            cout << "t" << flush; // ignored
    342353                        delete p;
    343354                    }
     
    374385
    375386    cout << "Created " << n << " gammas from source with E^" << alpha << endl;
    376     cout << "Processed " << Form("%.1f", n/(TStopwatch::GetRealTime()-starttime)) << " gammas/sec." << endl;
     387    cout << "Processing time: " << Form("%.1f", (TStopwatch::GetRealTime()-starttime)/n) << " sec/gamma." << endl;
    377388
    378389    // ------------------------------
Note: See TracChangeset for help on using the changeset viewer.