- Timestamp:
- 05/26/04 18:24:22 (20 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/mcalib/MHCalibrationChargeBlindPix.cc
r3963 r4198 96 96 const Double_t MHCalibrationChargeBlindPix::gkElectronicAmpErr = 0.002; 97 97 98 const Int_t MHCalibrationChargeBlindPix::fgChargeNbins = 300;99 const Axis_t MHCalibrationChargeBlindPix::fgChargeFirst = - 100.5;100 const Axis_t MHCalibrationChargeBlindPix::fgChargeLast = 5 199.5;101 const Float_t MHCalibrationChargeBlindPix::fgSinglePheCut = 200.;98 const Int_t MHCalibrationChargeBlindPix::fgChargeNbins = 1000; 99 const Axis_t MHCalibrationChargeBlindPix::fgChargeFirst = -0.5; 100 const Axis_t MHCalibrationChargeBlindPix::fgChargeLast = 5999.5; 101 const Float_t MHCalibrationChargeBlindPix::fgSinglePheCut = 600.; 102 102 const Float_t MHCalibrationChargeBlindPix::fgNumSinglePheLimit = 50.; 103 103 // -------------------------------------------------------------------------- … … 146 146 SetNumSinglePheLimit(); 147 147 148 SetBinsAfterStripping( 30);148 SetBinsAfterStripping(50); 149 149 150 150 fHGausHist.SetName("HCalibrationChargeBlindPix"); … … 216 216 fLambdaCheckErr = -999.; 217 217 218 fFitFunc = kEPoisson5; 218 fFitFunc = kEMichele; 219 // fFitFunc = kEPoisson4; 219 220 220 221 fNumSinglePhes = 0; … … 387 388 // 388 389 const Float_t signal = (Float_t)fSignal->GetExtractedSignal(); 389 if (signal > - 1)390 if (signal > -0.5) 390 391 FillHistAndArray(signal); 392 else 393 return kTRUE; 391 394 392 395 // … … 448 451 fBlindPix->SetSinglePheFitOK(); 449 452 else 450 fBlindPix->SetValid( kFALSE);451 452 fBlindPix->SetLambda ( fLambda 453 fBlindPix->SetLambdaVar ( fLambda Err*fLambdaErr );453 fBlindPix->SetValid(IsPedestalFitOK()); 454 455 fBlindPix->SetLambda ( fLambdaCheck ); 456 fBlindPix->SetLambdaVar ( fLambdaCheckErr*fLambdaCheckErr ); 454 457 fBlindPix->SetMu0 ( fMu0 ); 455 458 fBlindPix->SetMu0Err ( fMu0Err ); … … 462 465 fBlindPix->SetProb ( fProb ); 463 466 464 fBlindPix->SetLambdaCheck ( fLambda Check);465 fBlindPix->SetLambdaCheckErr ( fLambda CheckErr);467 fBlindPix->SetLambdaCheck ( fLambda ); 468 fBlindPix->SetLambdaCheckErr ( fLambdaErr ); 466 469 467 470 return kTRUE; … … 598 601 break; 599 602 case kEMichele: 600 break;601 603 fSinglePheFit = new TF1("SinglePheFit",&fFitFuncMichele,rmin,rmax,10); 604 break; 602 605 default: 603 606 *fLog << warn << "WARNING: Could not find Fit Function for Blind Pixel " << endl; … … 614 617 const Double_t mu_0_guess = maximum_bin; 615 618 const Double_t si_0_guess = 40.; 616 const Double_t mu_1_guess = mu_0_guess + 100.;619 const Double_t mu_1_guess = mu_0_guess + 4000.; 617 620 const Double_t si_1_guess = si_0_guess + si_0_guess; 618 621 // Michele 619 // const Double_t lambda_1cat_guess = 0.5; 620 // const Double_t lambda_1dyn_guess = 0.5; 621 // const Double_t mu_1cat_guess = mu_0_guess + 50.; 622 // const Double_t mu_1dyn_guess = mu_0_guess + 20.; 623 // const Double_t si_1cat_guess = si_0_guess + si_0_guess; 624 // const Double_t si_1dyn_guess = si_0_guess; 622 const Double_t lambda_1cat_guess = 0.005; 623 const Double_t lambda_1dyn_guess = 0.002; 624 // const Double_t mu_1cat_guess = mu_0_guess + 4500.; 625 // const Double_t mu_1dyn_guess = mu_0_guess + 2500.; 626 const Double_t mu_1cat_guess = mu_0_guess + 1000.; 627 const Double_t mu_1dyn_guess = mu_0_guess + 2500.; 628 const Double_t si_1cat_guess = 500.; 629 const Double_t si_1dyn_guess = 1000.; 630 const Double_t offset_guess = 0.5; 625 631 // Polya 626 632 const Double_t excessPoisson_guess = 0.5; … … 689 695 break; 690 696 case kEMichele: 697 fSinglePheFit->SetParameters(lambda_1cat_guess, lambda_1dyn_guess, 698 mu_0_guess, mu_1cat_guess,mu_1dyn_guess, 699 si_0_guess, si_1cat_guess,si_1dyn_guess, 700 norm, offset_guess); 701 fSinglePheFit->SetParNames("#lambda_{cat}","#lambda_{dyn}", 702 "#mu_{0}","#mu_{1cat}","#mu_{1dyn}", 703 "#sigma_{0}","#sigma_{1cat}","#sigma_{1dyn}", 704 "Area","offset"); 705 fSinglePheFit->SetParLimits(0,0.,0.2); 706 fSinglePheFit->SetParLimits(1,0.,0.05); 707 fSinglePheFit->SetParLimits(2,0.,fSinglePheCut); 708 // fSinglePheFit->SetParLimits(3,4000.,5500.); 709 // fSinglePheFit->SetParLimits(4,2500.,5000.); 710 fSinglePheFit->SetParLimits(3,fSinglePheCut,3000.); 711 fSinglePheFit->SetParLimits(4,fSinglePheCut,3500.); 712 fSinglePheFit->SetParLimits(5,0.,fSinglePheCut); 713 fSinglePheFit->SetParLimits(6,500.,1000.); 714 fSinglePheFit->SetParLimits(7,300.,1500.); 715 // fSinglePheFit->SetParLimits(6,300.,2000.); 716 // fSinglePheFit->SetParLimits(7,100.,2500.); 717 fSinglePheFit->SetParLimits(8,norm/1.1,norm*1.1); 718 fSinglePheFit->SetParLimits(9,0.,1.); 691 719 break; 692 720 … … 745 773 fSigma0Err = fSinglePheFit->GetParError(5); 746 774 fSigma1Err = 0.; 775 case kEMichele: 776 fLambda = fSinglePheFit->GetParameter(0); 777 fMu0 = fSinglePheFit->GetParameter(2); 778 fMu1 = fSinglePheFit->GetParameter(3); 779 fSigma0 = fSinglePheFit->GetParameter(5); 780 fSigma1 = fSinglePheFit->GetParameter(6); 781 782 fLambdaErr = fSinglePheFit->GetParError(0); 783 fMu0Err = fSinglePheFit->GetParError(2); 784 fMu1Err = fSinglePheFit->GetParError(3); 785 fSigma0Err = fSinglePheFit->GetParError(5); 786 fSigma1Err = fSinglePheFit->GetParError(6); 787 break; 747 788 default: 748 789 break; … … 832 873 // Perform the cross-check fitting only the pedestal: 833 874 const Axis_t rmin = 0.; 834 const Axis_t rmax = fHGausHist.GetBinCenter(fHGausHist.GetMaximumBin()); 875 // const Axis_t rmax = fHGausHist.GetBinCenter(fHGausHist.GetMaximumBin()); 876 const Axis_t rmax = fSinglePheCut; 835 877 836 878 FitGaus(opt, rmin, rmax); 837 879 838 880 const Stat_t entries = fHGausHist.Integral("width"); 839 const Double_t fitarea = fFGausFit->GetParameter(0); 840 const Double_t pedarea = fitarea * TMath::Sqrt(TMath::TwoPi()) * fFGausFit->GetParameter(2); 841 881 const Double_t pedarea = fFGausFit->Integral(0.,fSinglePheCut); 882 842 883 fLambdaCheck = TMath::Log(entries/pedarea); 843 fLambdaCheckErr = fFGausFit->GetParError(0)/fFGausFit->GetParameter(0) 844 + fFGausFit->GetParError(2)/fFGausFit->GetParameter(2); 845 846 847 SetPedestalFitOK(); 884 // estimate the error by the error of the obtained area from the Gauss-function: 885 fLambdaCheckErr = fFGausFit->GetParError(0)/fFGausFit->GetParameter(0); 886 887 SetPedestalFitOK(IsGausFitOK()); 848 888 return; 849 889 } … … 861 901 fFitLegend = new TPaveText(0.05,0.05,0.95,0.95); 862 902 fFitLegend->SetLabel(Form("%s%s", "Results of the single PhE Fit (", 863 (fFitFunc = kEPoisson4) ? "Poisson(k=4))" :864 (fFitFunc = kEPoisson5) ? "Poisson(k=5))" :865 (fFitFunc = kEPoisson6) ? "Poisson(k=4))" :866 (fFitFunc = kEPolya ) ? "Polya(k=4))" :867 (fFitFunc = kEMichele ) ? "Michele)" : " none )" ));903 (fFitFunc == kEPoisson4) ? "Poisson(k=4))" : 904 (fFitFunc == kEPoisson5) ? "Poisson(k=5))" : 905 (fFitFunc == kEPoisson6) ? "Poisson(k=6))" : 906 (fFitFunc == kEPolya ) ? "Polya(k=4))" : 907 (fFitFunc == kEMichele ) ? "Michele)" : " none )" )); 868 908 fFitLegend->SetTextSize(0.05); 869 909 } … … 979 1019 fFGausFit->SetLineColor(kBlue); 980 1020 fFGausFit->Draw("same"); 1021 TLine *line = new TLine(fSinglePheCut, 0., fSinglePheCut, 10.); 1022 line->SetBit(kCanDelete); 1023 line->SetLineColor(kBlue); 1024 line->SetLineWidth(3); 1025 line->DrawLine(fSinglePheCut, 0., fSinglePheCut, 2.); 981 1026 } 982 1027 if (fSinglePheFit) … … 985 1030 fSinglePheFit->Draw("same"); 986 1031 } 1032 987 1033 988 1034 pad->cd(2);
Note:
See TracChangeset
for help on using the changeset viewer.