Ignore:
Timestamp:
02/28/07 13:34:10 (18 years ago)
Author:
tbretz
Message:
*** empty log message ***
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/MagicSoft/Mars/macros/tutorials/mirrordelay.C

    r8322 r8337  
    2525void mirrordelay()
    2626{
    27     TF1 fpar("Parab",  "[0]*x*x");
    28     TF1 fsph("Sphere", "-sqrt([0]*[0] - x*x)+[0]");
     27    TF1 fpar("Parab",  "x*x/(4*[0])");
     28    TF1 fsph("Sphere", "-sqrt(4*[0]*[0] - x*x) + 2*[0]");
    2929
    3030    Double_t F = 4.92; // Fokallaenge = 1/4a
    3131    Double_t D = 4.5;  // Mirror Diameter
    3232    Double_t x = 1.85; // incident point for photon
    33 
     33                                     
    3434    fsph.SetRange(-D*0.55, D*0.55);
    3535    fpar.SetRange(-D*0.55, D*0.55);
    3636
    37     fpar.SetParameter(0, 1./(4*F));
     37    fpar.SetParameter(0, F);
    3838    fsph.SetParameter(0, F);
    3939
     
    7979    TLegend leg(0.40, 0.6, 0.60, 0.85);//, "NDC");
    8080
    81     TF1 fdel("Diff", "(Sphere-Parab+TMath::Hypot(x-0, Parab-[0])-[0])/3e8*1e9");
    82     fdel.SetRange(-D*0.55, D*0.55);
    83     fdel.SetLineWidth(2);
    84 
    8581    for (int i=-2; i<3; i++)
    8682    {
     83        // Make sure to set the parameters BEFORE reusing the function!
     84        fsph.SetParameter(0, F+i*0.10*F);
     85        fpar.SetParameter(0, F+i*0.10*F);
    8786
     87        TF1 fdel1("Diff1", "Sphere-Parab");
     88        TF1 fdel2("Diff2", "TMath::Hypot(x-0, Parab-[0])-TMath::Hypot(x-0, Sphere-[0])");
     89        fdel2.SetParameter(0, F+i*0.10*F);
     90
     91        TF1 fdel("Diff", "(Diff1+Diff2)/3e8*1e9");
     92        fdel.SetRange(-D*0.55, D*0.55);
     93        fdel.SetLineWidth(2);
    8894        fdel.SetParameter(0, F+i*0.10*F);
     95
    8996        fdel.SetLineColor(kBlack+(abs(i)==2?3:abs(i)));
    9097        if (i<0)
     
    98105
    99106        f->GetXaxis()->SetTitle("x [m]");
    100         f->GetYaxis()->SetTitle("Delay \\Delta t [ns]");
     107        f->GetYaxis()->SetTitle("Delay  \\Delta t [ns]");
    101108        f->GetXaxis()->CenterTitle();
    102109
Note: See TracChangeset for help on using the changeset viewer.