- Timestamp:
- 02/12/04 19:56:16 (21 years ago)
- Location:
- trunk/MagicSoft/Mars
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/Changelog
r3124 r3125 33 33 variable: MCalibrationCalc::fBlindPixelSinglePheCut, to be set 34 34 with a setter 35 36 * mtools/MFFT.[h,cc] 37 - PowerSpectrumDensity of TArrayI implemented 35 38 36 39 -
trunk/MagicSoft/Mars/mcalib/MHCalibrationBlindPixel.cc
r3120 r3125 687 687 { 688 688 689 *fLog << err << "min: " << min << endl; 690 *fLog << err << "max: " << max << endl; 691 689 692 // 690 693 // First guesses for the fit (should be as close to reality as possible, … … 692 695 // 693 696 const Stat_t entries = fHBlindPixelCharge->Integral("width"); 694 const Double_t lambda_guess = 0. 5;697 const Double_t lambda_guess = 0.1; 695 698 const Double_t maximum_bin = fHBlindPixelCharge->GetBinCenter(fHBlindPixelCharge->GetMaximumBin()); 696 699 const Double_t norm = entries/gkSq2Pi; … … 740 743 const Double_t electronicAmp_limit = fgBlindPixelElectronicAmpError; 741 744 745 *fLog << err << "pedestal: " << fMeanPedestal << endl; 746 *fLog << err << "sigma: " << fSigmaPedestal << endl; 747 742 748 // 743 749 // Initialize boundaries and start parameters … … 754 760 fSinglePheFit->SetParNames("#lambda","#mu_{0}","#mu_{1}","#sigma_{0}","#sigma_{1}","Area"); 755 761 756 fSinglePheFit->SetParLimits(0,0., 1.);762 fSinglePheFit->SetParLimits(0,0.,0.5); 757 763 758 764 if ((fMeanPedestal) && (fSigmaPedestal)) 759 765 fSinglePheFit->SetParLimits(1, 760 fMeanPedestal- 1.*fMeanPedestalErr,761 fMeanPedestal+ 1.*fMeanPedestalErr);766 fMeanPedestal-5.*fMeanPedestalErr, 767 fMeanPedestal+5.*fMeanPedestalErr); 762 768 else 763 769 fSinglePheFit->SetParLimits(1,-3.,0.); 764 770 765 fSinglePheFit->SetParLimits(2, (max-min)/2.,max);771 fSinglePheFit->SetParLimits(2,min,max); 766 772 767 773 if ((fMeanPedestal) && (fSigmaPedestal)) 768 774 fSinglePheFit->SetParLimits(3, 769 fSigmaPedestal- 3.*fSigmaPedestalErr,770 fSigmaPedestal+ 3.*fSigmaPedestalErr);775 fSigmaPedestal-5.*fSigmaPedestalErr, 776 fSigmaPedestal+5.*fSigmaPedestalErr); 771 777 else 772 778 fSinglePheFit->SetParLimits(3,1.0,(max-min)/2.0); 773 779 774 fSinglePheFit->SetParLimits(4, 1.0,(max-min));775 fSinglePheFit->SetParLimits(5,norm- 0.5,norm+0.5);780 fSinglePheFit->SetParLimits(4,0.,(max-min)); 781 fSinglePheFit->SetParLimits(5,norm-(0.5*norm),norm+(0.5*norm)); 776 782 break; 777 783 case kEPoisson5: … … 894 900 rmin = (rmin != 0.) ? rmin : fBlindPixelChargefirst; 895 901 rmax = (rmax != 0.) ? rmax : fBlindPixelChargelast; 896 897 902 if (!InitFit(rmin,rmax)) 898 903 return kFALSE; … … 956 961 { 957 962 958 Int_t nbins = 30;963 Int_t nbins = 25; 959 964 960 965 CutEdges(fHBlindPixelCharge,nbins); … … 1002 1007 1003 1008 } 1009 -
trunk/MagicSoft/Mars/mtools/MFFT.cc
r3084 r3125 700 700 701 701 702 // 703 // Power Spectrum Density calculation for TArrayI 704 // 705 TArrayF* MFFT::PowerSpectrumDensity(const TArrayI *array) 706 { 707 708 fDim = array->GetSize(); 709 CheckDim(fDim); 710 711 fDataF.Set(fDim); 712 // 713 // Copy the hist into an array 714 // 715 for (Int_t i=0;i<fDim;i++) 716 fDataF[i] = (Float_t)array->At(i); 717 718 RealFTF(1); 719 720 const Int_t dim2 = fDim*fDim; 721 const Int_t dim05 = fDim/2; 722 Float_t c02; 723 Float_t ck2; 724 Float_t cn2; 725 726 TArrayF *newarray = new TArrayF(dim05); 727 728 // 729 // Fill the new histogram: 730 // 731 // 1) P(0) = 1/(N*N) |C(0)|*|C(0)| 732 // 733 c02 = (fDataF[0]*fDataF[0]); 734 // newarray->AddAt(c02/dim2,0); 735 // 736 // 2) P(k) = 1/(N*N) (|C(k)|*|C(k)|)) 737 // 738 for (Int_t k=1;k<dim05-1;k++) 739 { 740 const Int_t k2 = k+k; 741 ck2 = (fDataF[k2]*fDataF[k2] + fDataF[k2+1]*fDataF[k2+1]); 742 newarray->AddAt(ck2/dim2,k); 743 } 744 // 745 // 3) P(N) = 1/(N*N) (|C(n/2)|*|C(n/2)|) 746 // 747 cn2 = (fDataF[1]*fDataF[1]); 748 // newarray->AddAt(cn2,dim05-1); 749 750 return newarray; 751 } 752 753 702 754 TArrayD* MFFT::PowerSpectrumDensity(const TArrayD *array) 703 755 { -
trunk/MagicSoft/Mars/mtools/MFFT.h
r3084 r3125 74 74 TH1D* PowerSpectrumDensity(const TH1D *hist); 75 75 76 TArrayF* PowerSpectrumDensity(const TArrayI *array); 76 77 TArrayF* PowerSpectrumDensity(const TArrayF *array); 77 78 TArrayD* PowerSpectrumDensity(const TArrayD *array);
Note:
See TracChangeset
for help on using the changeset viewer.