Changeset 8337 for trunk/MagicSoft/Mars/macros
- Timestamp:
- 02/28/07 13:34:10 (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/macros/tutorials/mirrordelay.C
r8322 r8337 25 25 void mirrordelay() 26 26 { 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]"); 29 29 30 30 Double_t F = 4.92; // Fokallaenge = 1/4a 31 31 Double_t D = 4.5; // Mirror Diameter 32 32 Double_t x = 1.85; // incident point for photon 33 33 34 34 fsph.SetRange(-D*0.55, D*0.55); 35 35 fpar.SetRange(-D*0.55, D*0.55); 36 36 37 fpar.SetParameter(0, 1./(4*F));37 fpar.SetParameter(0, F); 38 38 fsph.SetParameter(0, F); 39 39 … … 79 79 TLegend leg(0.40, 0.6, 0.60, 0.85);//, "NDC"); 80 80 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 85 81 for (int i=-2; i<3; i++) 86 82 { 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); 87 86 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); 88 94 fdel.SetParameter(0, F+i*0.10*F); 95 89 96 fdel.SetLineColor(kBlack+(abs(i)==2?3:abs(i))); 90 97 if (i<0) … … 98 105 99 106 f->GetXaxis()->SetTitle("x [m]"); 100 f->GetYaxis()->SetTitle("Delay \\Delta t [ns]");107 f->GetYaxis()->SetTitle("Delay \\Delta t [ns]"); 101 108 f->GetXaxis()->CenterTitle(); 102 109
Note:
See TracChangeset
for help on using the changeset viewer.