Changeset 5876 for trunk/MagicSoft/Mars/mcalib
- Timestamp:
- 01/17/05 16:39:19 (20 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/mcalib/MCalibrationChargeCam.cc
r5843 r5876 691 691 TH1D *h = convcam.ProjectionS(TArrayI(),TArrayI(1,&aidx),"_py",750); 692 692 h->SetDirectory(NULL); 693 h->Fit("gaus","Q"); 694 TF1 *fit = h->GetFunction("gaus"); 695 693 694 TF1 *fit = NULL; 695 696 if (geom.InheritsFrom("MGeomCamMagic")) 697 { 698 699 fit = new TF1("fit","gaus",0.4,5.); 700 701 // Fix the ranges, as found by Nadia 702 if(aidx == 0) 703 {h->Fit("fit","REQ", "",0.4,1.5);} 704 else 705 {h->Fit("fit","REQ", "",1.,5.);} 706 } 707 else 708 { 709 h->Fit("gaus","Q"); 710 fit = h->GetFunction("gaus"); 711 } 712 696 713 Float_t ci2 = fit->GetChisquare(); 697 714 Float_t sigma = fit->GetParameter(2); … … 699 716 if (ci2 > 500. || sigma > sg) 700 717 { 701 h->Fit("gaus","QM"); 702 fit = h->GetFunction("gaus"); 718 if (geom.InheritsFrom("MGeomCamMagic")) 719 { 720 // Fix the ranges, as found by Nadia 721 if(aidx == 0) 722 {h->Fit("fit","REQ", "",0.4,1.5);} 723 else 724 {h->Fit("fit","REQ", "",1.,5.);} 725 } 726 else 727 { 728 h->Fit("gaus","MREQ"); 729 fit = h->GetFunction("gaus"); 730 } 703 731 704 732 ci2 = fit->GetChisquare(); … … 720 748 << " Chisquare: " << Form("%4.3f",fit->GetChisquare()) << " NDF : " << ndf << endl; 721 749 750 delete fit; 722 751 delete h; 723 752 gROOT->GetListOfFunctions()->Remove(fit);
Note:
See TracChangeset
for help on using the changeset viewer.