Changeset 3075 for trunk/MagicSoft/Mars/mcalib
- Timestamp:
- 02/09/04 22:50:52 (21 years ago)
- Location:
- trunk/MagicSoft/Mars/mcalib
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/mcalib/MCalibrationCalc.cc
r3072 r3075 445 445 fEvents++; 446 446 447 Float_t referencetime = 0.;447 // Float_t referencetime = 0.; 448 448 449 449 // … … 468 468 469 469 Float_t abstime = 0.; 470 #if 0 470 471 Float_t reltime = 0.; 471 472 472 #if 0473 473 if (TESTBIT(fFlags,kUseTimes)) 474 474 { … … 702 702 fCalibrations->SetBlindPixelMethodValid(kFALSE); 703 703 } 704 705 blindpixel.CheckOscillations(); 706 707 fCalibrations->SetBlindPixelMethodValid(kTRUE); 704 else 705 fCalibrations->SetBlindPixelMethodValid(kTRUE); 706 707 if (blindpixel.CheckOscillations()) 708 fCalibrations->SetBlindPixelMethodValid(kFALSE); 709 708 710 blindpixel.DrawClone(); 709 711 } … … 753 755 if (TESTBIT(fFlags,kUseBlindPixelFit) && fCalibrations->IsBlindPixelMethodValid()) 754 756 { 755 756 if (!fCalibrations->CalcNumPhotInsidePlexiglass()) 757 if (!fCalibrations->CalcFluxInsidePlexiglass()) 757 758 { 758 759 *fLog << err … … 760 761 *fLog << err 761 762 << "You can try to calibrate using the MCalibrationCalc::SkipBlindPixelFit()" << endl; 762 fCalibrations->SetBlindPixelMethodValid(kFALSE);763 fCalibrations->SetBlindPixelMethodValid(kFALSE); 763 764 } 764 765 } … … 769 770 if (TESTBIT(fFlags,kUsePinDiodeFit) && fCalibrations->IsPINDiodeMethodValid()) 770 771 { 771 772 if (!fCalibrations->CalcNumPhotInsidePlexiglass()) 772 if (!fCalibrations->CalcFluxOutsidePlexiglass()) 773 773 { 774 774 *fLog << err -
trunk/MagicSoft/Mars/mcalib/MCalibrationCam.cc
r3065 r3075 184 184 fPINDiode->Clear(); 185 185 186 fMean PhotInsidePlexiglass = -1.;187 fMean PhotErrInsidePlexiglass = -1.;188 fMean PhotOutsidePlexiglass = -1.;189 fMean PhotErrOutsidePlexiglass = -1.;186 fMeanFluxInsidePlexiglass = -1.; 187 fMeanFluxErrInsidePlexiglass = -1.; 188 fMeanFluxOutsidePlexiglass = -1.; 189 fMeanFluxErrOutsidePlexiglass = -1.; 190 190 191 191 fNumExcludedPixels = 0; … … 193 193 CLRBIT(fFlags,kBlindPixelMethodValid); 194 194 CLRBIT(fFlags,kPINDiodeMethodValid); 195 CLRBIT(fFlags,k NumPhotInsidePlexiglassAvailable);196 CLRBIT(fFlags,k NumPhotOutsidePlexiglassAvailable);195 CLRBIT(fFlags,kFluxInsidePlexiglassAvailable); 196 CLRBIT(fFlags,kFluxOutsidePlexiglassAvailable); 197 197 198 198 return; … … 231 231 232 232 233 Bool_t MCalibrationCam::Is NumPhotInsidePlexiglassAvailable() const234 { 235 return TESTBIT(fFlags,k NumPhotInsidePlexiglassAvailable);236 } 237 238 Bool_t MCalibrationCam::Is NumPhotOutsidePlexiglassAvailable() const239 { 240 return TESTBIT(fFlags,k NumPhotOutsidePlexiglassAvailable);233 Bool_t MCalibrationCam::IsFluxInsidePlexiglassAvailable() const 234 { 235 return TESTBIT(fFlags,kFluxInsidePlexiglassAvailable); 236 } 237 238 Bool_t MCalibrationCam::IsFluxOutsidePlexiglassAvailable() const 239 { 240 return TESTBIT(fFlags,kFluxOutsidePlexiglassAvailable); 241 241 } 242 242 … … 262 262 { 263 263 264 if (pix->IsChargeValid() && !pix->IsExcluded() )264 if (pix->IsChargeValid() && !pix->IsExcluded() && !pix->IsOscillating() && pix->IsFitted()) 265 265 { 266 266 … … 284 284 { 285 285 286 if (!pix->IsChargeValid() && !pix->IsExcluded() )286 if (!pix->IsChargeValid() && !pix->IsExcluded() && !pix->IsFitted()) 287 287 { 288 288 … … 294 294 } 295 295 *fLog << all << id << " pixels with errors :-((" << endl; 296 297 *fLog << all << endl; 298 *fLog << all << "Pixels with oscillations:" << endl; 299 *fLog << all << endl; 300 301 id = 0; 302 303 TIter Next3(fPixels); 304 while ((pix=(MCalibrationPix*)Next3())) 305 { 306 307 if (pix->IsOscillating() && !pix->IsExcluded()) 308 { 309 310 *fLog << all << pix->GetPixId() << " Pedestals: " << pix->GetPed() << " +- " 311 << pix->GetPedRms() << " Reduced Charge: " << pix->GetCharge() << " +- " 312 << pix->GetSigmaCharge() << " Reduced Sigma: " << pix->GetRSigmaCharge() << endl; 313 Float_t area = (*fGeomCam)[pix->GetPixId()].GetA(); 314 *fLog << "Area: " << area << endl; 315 pix->DrawClone(); 316 id++; 317 } 318 } 319 *fLog << all << id << " Oscillating pixels :-((" << endl; 320 296 321 297 322 *fLog << all << endl; … … 299 324 *fLog << all << endl; 300 325 301 TIter Next 3(fPixels);302 while ((pix=(MCalibrationPix*)Next3()))303 326 TIter Next4(fPixels); 327 while ((pix=(MCalibrationPix*)Next4())) 328 if (pix->IsExcluded()) 304 329 *fLog << all << pix->GetPixId() << endl; 305 330 … … 381 406 return kFALSE; 382 407 383 Float_t area ratio = cam.GetPixRatio(idx);384 385 if (area ratio== 0)408 Float_t area = cam[idx].GetA()/100.; 409 410 if (area == 0) 386 411 return kFALSE; 387 412 … … 475 500 if ((*this)[idx].IsExcluded()) 476 501 return kFALSE; 477 if (arearatio == 1.) 478 val = GetMeanPhotInsidePlexiglass(); 479 else 480 val = GetMeanPhotInsidePlexiglass()*gkCalibrationOutervsInnerPixelArea; 502 val = GetMeanFluxInsidePlexiglass()*area; 481 503 break; 482 504 case 16: 483 505 if ((*this)[idx].IsExcluded()) 484 506 return kFALSE; 485 if (arearatio == 1.) 486 val = (double)fMeanPhotInsidePlexiglass; 487 else 488 val = (double)fMeanPhotInsidePlexiglass*gkCalibrationOutervsInnerPixelArea; 507 val = GetMeanFluxInsidePlexiglass()*area; 489 508 break; 490 509 case 17: 491 510 if ((*this)[idx].IsExcluded()) 492 511 return kFALSE; 493 if (arearatio == 1.) 494 val = (*this)[idx].GetMeanConversionBlindPixelMethod(); 495 else 496 val = (*this)[idx].GetMeanConversionBlindPixelMethod()*gkCalibrationOutervsInnerPixelArea; 512 val = (*this)[idx].GetMeanConversionBlindPixelMethod(); 497 513 break; 498 514 case 18: 499 515 if ((*this)[idx].IsExcluded()) 500 516 return kFALSE; 501 if (arearatio == 1.) 502 val = (*this)[idx].GetErrorConversionBlindPixelMethod(); 503 else 504 { 505 val = (*this)[idx].GetErrorConversionBlindPixelMethod()*(*this)[idx].GetErrorConversionBlindPixelMethod() 506 * gkCalibrationOutervsInnerPixelArea * gkCalibrationOutervsInnerPixelArea; 507 val += gkCalibrationOutervsInnerPixelAreaError * gkCalibrationOutervsInnerPixelAreaError 508 * (*this)[idx].GetMeanConversionBlindPixelMethod() *(*this)[idx].GetMeanConversionBlindPixelMethod(); 509 val = TMath::Sqrt(val); 510 } 517 val = (*this)[idx].GetErrorConversionBlindPixelMethod(); 511 518 break; 512 519 case 19: … … 523 530 if ((*this)[idx].IsExcluded()) 524 531 return kFALSE; 525 if (arearatio == 1.) 526 val = GetMeanPhotOutsidePlexiglass(); 527 else 528 val = GetMeanPhotOutsidePlexiglass()*gkCalibrationOutervsInnerPixelArea; 532 val = GetMeanFluxOutsidePlexiglass()*area; 529 533 break; 530 534 case 22: 531 535 if ((*this)[idx].IsExcluded()) 532 536 return kFALSE; 533 if (arearatio == 1.) 534 val = (double)fMeanPhotOutsidePlexiglass; 535 else 536 val = (double)fMeanPhotOutsidePlexiglass*gkCalibrationOutervsInnerPixelArea; 537 val = GetMeanFluxOutsidePlexiglass()*area; 537 538 break; 538 539 case 23: 539 540 if ((*this)[idx].IsExcluded()) 540 541 return kFALSE; 541 if (arearatio == 1.) 542 val = (*this)[idx].GetMeanConversionPINDiodeMethod(); 543 else 544 val = (*this)[idx].GetMeanConversionPINDiodeMethod()*gkCalibrationOutervsInnerPixelArea; 542 val = (*this)[idx].GetMeanConversionPINDiodeMethod(); 545 543 break; 546 544 case 24: 547 545 if ((*this)[idx].IsExcluded()) 548 546 return kFALSE; 549 if (arearatio == 1.) 550 val = (*this)[idx].GetErrorConversionPINDiodeMethod(); 551 else 552 { 553 val = (*this)[idx].GetErrorConversionPINDiodeMethod()*(*this)[idx].GetErrorConversionPINDiodeMethod() 554 * gkCalibrationOutervsInnerPixelArea * gkCalibrationOutervsInnerPixelArea; 555 val += gkCalibrationOutervsInnerPixelAreaError * gkCalibrationOutervsInnerPixelAreaError 556 * (*this)[idx].GetMeanConversionPINDiodeMethod() *(*this)[idx].GetMeanConversionPINDiodeMethod(); 557 val = TMath::Sqrt(val); 558 } 547 val = (*this)[idx].GetErrorConversionPINDiodeMethod(); 559 548 break; 560 549 case 25: … … 694 683 // 695 684 // 696 Bool_t MCalibrationCam::Calc NumPhotInsidePlexiglass()685 Bool_t MCalibrationCam::CalcFluxInsidePlexiglass() 697 686 { 698 687 … … 707 696 // 708 697 // The blind pixel has exactly one cm^2 area (with negligible error), 709 // thus we omi division by 1.698 // thus we omit division by 1. 710 699 // 711 fMean PhotInsidePlexiglass = mean * gkCalibrationInnerPixelArea;700 fMeanFluxInsidePlexiglass = mean; 712 701 713 702 // Start calculation of number of photons relative Variance (!!) 714 fMeanPhotErrInsidePlexiglass = merr*merr/mean/mean; 715 fMeanPhotErrInsidePlexiglass += gkCalibrationInnerPixelAreaError*gkCalibrationInnerPixelAreaError 716 / gkCalibrationInnerPixelArea/gkCalibrationInnerPixelArea; 703 fMeanFluxErrInsidePlexiglass = merr*merr/mean/mean; 717 704 718 705 switch (fColor) 719 706 { 720 707 case kECGreen: 721 fMean PhotInsidePlexiglass /= gkCalibrationBlindPixelQEGreen;722 fMean PhotErrInsidePlexiglass += gkCalibrationBlindPixelQEGreenError*gkCalibrationBlindPixelQEGreenError708 fMeanFluxInsidePlexiglass /= gkCalibrationBlindPixelQEGreen; 709 fMeanFluxErrInsidePlexiglass += gkCalibrationBlindPixelQEGreenError*gkCalibrationBlindPixelQEGreenError 723 710 / gkCalibrationBlindPixelQEGreen / gkCalibrationBlindPixelQEGreen; 724 711 725 fMean PhotInsidePlexiglass*= TMath::Power(10,gkCalibrationBlindPixelAttGreen); // correct for absorption712 fMeanFluxInsidePlexiglass *= TMath::Power(10,gkCalibrationBlindPixelAttGreen); // correct for absorption 726 713 // attenuation has negligible error 727 714 break; 728 715 case kECBlue: 729 fMean PhotInsidePlexiglass /= gkCalibrationBlindPixelQEBlue;730 fMean PhotErrInsidePlexiglass += gkCalibrationBlindPixelQEBlueError*gkCalibrationBlindPixelQEBlueError716 fMeanFluxInsidePlexiglass /= gkCalibrationBlindPixelQEBlue; 717 fMeanFluxErrInsidePlexiglass += gkCalibrationBlindPixelQEBlueError*gkCalibrationBlindPixelQEBlueError 731 718 / gkCalibrationBlindPixelQEBlue / gkCalibrationBlindPixelQEBlue; 732 719 733 fMean PhotInsidePlexiglass *= TMath::Power(10,gkCalibrationBlindPixelAttBlue); // correct for absorption720 fMeanFluxInsidePlexiglass *= TMath::Power(10,gkCalibrationBlindPixelAttBlue); // correct for absorption 734 721 // attenuation has negligible error 735 722 break; 736 723 case kECUV: 737 fMean PhotInsidePlexiglass /= gkCalibrationBlindPixelQEUV;738 fMean PhotErrInsidePlexiglass += gkCalibrationBlindPixelQEUVError*gkCalibrationBlindPixelQEUVError724 fMeanFluxInsidePlexiglass /= gkCalibrationBlindPixelQEUV; 725 fMeanFluxErrInsidePlexiglass += gkCalibrationBlindPixelQEUVError*gkCalibrationBlindPixelQEUVError 739 726 / gkCalibrationBlindPixelQEUV / gkCalibrationBlindPixelQEUV; 740 727 741 fMean PhotInsidePlexiglass *= TMath::Power(10,gkCalibrationBlindPixelAttUV); // correct for absorption728 fMeanFluxInsidePlexiglass *= TMath::Power(10,gkCalibrationBlindPixelAttUV); // correct for absorption 742 729 // attenuation has negligible error 743 730 break; 744 731 case kECCT1: 745 732 default: 746 fMean PhotInsidePlexiglass /= gkCalibrationBlindPixelQECT1;747 fMean PhotErrInsidePlexiglass += gkCalibrationBlindPixelQECT1Error*gkCalibrationBlindPixelQECT1Error733 fMeanFluxInsidePlexiglass /= gkCalibrationBlindPixelQECT1; 734 fMeanFluxErrInsidePlexiglass += gkCalibrationBlindPixelQECT1Error*gkCalibrationBlindPixelQECT1Error 748 735 / gkCalibrationBlindPixelQECT1 / gkCalibrationBlindPixelQECT1; 749 736 750 fMean PhotInsidePlexiglass *= TMath::Power(10,gkCalibrationBlindPixelAttCT1); // correct for absorption737 fMeanFluxInsidePlexiglass *= TMath::Power(10,gkCalibrationBlindPixelAttCT1); // correct for absorption 751 738 // attenuation has negligible error 752 739 break; … … 754 741 755 742 *fLog << inf << endl; 756 *fLog << inf << " Mean number of Photons for an Inner Pixel (inside Plexiglass): "757 << fMean PhotInsidePlexiglass << endl;758 759 if (fMean PhotInsidePlexiglass > 0.)760 SETBIT(fFlags,k NumPhotInsidePlexiglassAvailable);743 *fLog << inf << " Photon flux [ph/cm^2] inside Plexiglass: " 744 << fMeanFluxInsidePlexiglass << endl; 745 746 if (fMeanFluxInsidePlexiglass > 0.) 747 SETBIT(fFlags,kFluxInsidePlexiglassAvailable); 761 748 else 762 749 { 763 CLRBIT(fFlags,k NumPhotInsidePlexiglassAvailable);750 CLRBIT(fFlags,kFluxInsidePlexiglassAvailable); 764 751 return kFALSE; 765 752 } 766 753 767 if (fMean PhotErrInsidePlexiglass < 0.)768 { 769 *fLog << warn << " Relative Variance on number of Photons for an Inner Pixel (inside Plexiglass): "770 << fMean PhotErrInsidePlexiglass << endl;771 CLRBIT(fFlags,k NumPhotInsidePlexiglassAvailable);754 if (fMeanFluxErrInsidePlexiglass < 0.) 755 { 756 *fLog << warn << " Relative Variance on Photon flux inside Plexiglass: " 757 << fMeanFluxErrInsidePlexiglass << endl; 758 CLRBIT(fFlags,kFluxInsidePlexiglassAvailable); 772 759 return kFALSE; 773 760 } 774 761 775 762 // Finish calculation of errors -> convert from relative variance to absolute error 776 fMean PhotErrInsidePlexiglass = TMath::Sqrt(fMeanPhotErrInsidePlexiglass);777 fMean PhotErrInsidePlexiglass *= fMeanPhotInsidePlexiglass;778 779 *fLog << inf << " Error on number of Photons for an Inner Pixel (inside Plexiglass): "780 << fMean PhotErrInsidePlexiglass << endl;763 fMeanFluxErrInsidePlexiglass = TMath::Sqrt(fMeanFluxErrInsidePlexiglass); 764 fMeanFluxErrInsidePlexiglass *= fMeanFluxInsidePlexiglass; 765 766 *fLog << inf << " Error on photon flux [ph/cm^2] inside Plexiglass: " 767 << fMeanFluxErrInsidePlexiglass << endl; 781 768 *fLog << inf << endl; 782 783 784 769 785 770 TIter Next(fPixels); … … 790 775 if(pix->IsChargeValid()) 791 776 { 777 778 const Int_t idx = pix->GetPixId(); 792 779 793 780 const Float_t charge = pix->GetCharge(); 794 const Float_t ratio = fGeomCam->GetPixRatio(pix->GetPixId());781 const Float_t area = (*fGeomCam)[idx].GetA()/100.; 795 782 const Float_t chargeerr = pix->GetErrCharge(); 796 783 797 Float_t nphot; 798 Float_t nphoterr; 799 800 if (ratio == 1.) 801 { 802 nphot = fMeanPhotInsidePlexiglass; 803 nphoterr = fMeanPhotErrInsidePlexiglass; 804 } 805 else 806 { 807 nphot = fMeanPhotInsidePlexiglass*gkCalibrationOutervsInnerPixelArea; 808 nphoterr = fMeanPhotErrInsidePlexiglass*gkCalibrationOutervsInnerPixelArea 809 *fMeanPhotErrInsidePlexiglass*gkCalibrationOutervsInnerPixelArea; 810 nphoterr += fMeanPhotInsidePlexiglass*gkCalibrationOutervsInnerPixelAreaError 811 *fMeanPhotInsidePlexiglass*gkCalibrationOutervsInnerPixelAreaError; 812 nphoterr = TMath::Sqrt(nphoterr); 813 } 814 815 816 817 const Float_t conversion = nphot/charge; 784 const Float_t nphot = fMeanFluxInsidePlexiglass*area; 785 const Float_t nphoterr = fMeanFluxErrInsidePlexiglass*area; 786 const Float_t conversion = nphot/charge; 818 787 Float_t conversionerr; 819 788 … … 837 806 838 807 839 Bool_t MCalibrationCam::Calc NumPhotOutsidePlexiglass()808 Bool_t MCalibrationCam::CalcFluxOutsidePlexiglass() 840 809 { 841 810 … … 847 816 848 817 // Start calculation of number of photons 849 fMean PhotOutsidePlexiglass = mean * gkCalibrationInnerPixelvsPINDiodeArea;818 fMeanFluxOutsidePlexiglass = mean * gkCalibrationFluxCameravsPINDiode; 850 819 851 820 // Start calculation of number of photons relative Variance (!!) 852 fMean PhotErrOutsidePlexiglass = merr*merr/mean/mean;853 fMean PhotErrOutsidePlexiglass += gkCalibrationInnerPixelvsPINDiodeAreaError*gkCalibrationInnerPixelvsPINDiodeAreaError854 / gkCalibration InnerPixelvsPINDiodeArea/gkCalibrationInnerPixelvsPINDiodeArea;821 fMeanFluxErrOutsidePlexiglass = merr*merr/mean/mean; 822 fMeanFluxErrOutsidePlexiglass += gkCalibrationFluxCameravsPINDiodeError*gkCalibrationFluxCameravsPINDiodeError 823 / gkCalibrationFluxCameravsPINDiode/gkCalibrationFluxCameravsPINDiode; 855 824 856 825 switch (fColor) 857 826 { 858 827 case kECGreen: 859 fMean PhotOutsidePlexiglass /= gkCalibrationPINDiodeQEGreen;860 fMean PhotErrOutsidePlexiglass += gkCalibrationPINDiodeQEGreenError*gkCalibrationPINDiodeQEGreenError828 fMeanFluxOutsidePlexiglass /= gkCalibrationPINDiodeQEGreen; 829 fMeanFluxErrOutsidePlexiglass += gkCalibrationPINDiodeQEGreenError*gkCalibrationPINDiodeQEGreenError 861 830 / gkCalibrationPINDiodeQEGreen/gkCalibrationPINDiodeQEGreen; 862 831 break; 863 832 case kECBlue: 864 fMean PhotOutsidePlexiglass /= gkCalibrationPINDiodeQEBlue;865 fMean PhotErrOutsidePlexiglass += gkCalibrationPINDiodeQEBlueError*gkCalibrationPINDiodeQEBlueError833 fMeanFluxOutsidePlexiglass /= gkCalibrationPINDiodeQEBlue; 834 fMeanFluxErrOutsidePlexiglass += gkCalibrationPINDiodeQEBlueError*gkCalibrationPINDiodeQEBlueError 866 835 / gkCalibrationPINDiodeQEBlue/gkCalibrationPINDiodeQEBlue; 867 836 break; 868 837 case kECUV: 869 fMean PhotOutsidePlexiglass /= gkCalibrationPINDiodeQEUV;870 fMean PhotErrOutsidePlexiglass += gkCalibrationPINDiodeQEUVError*gkCalibrationPINDiodeQEUVError838 fMeanFluxOutsidePlexiglass /= gkCalibrationPINDiodeQEUV; 839 fMeanFluxErrOutsidePlexiglass += gkCalibrationPINDiodeQEUVError*gkCalibrationPINDiodeQEUVError 871 840 / gkCalibrationPINDiodeQEUV/gkCalibrationPINDiodeQEUV; 872 841 break; 873 842 case kECCT1: 874 843 default: 875 fMean PhotOutsidePlexiglass /= gkCalibrationPINDiodeQECT1;876 fMean PhotErrOutsidePlexiglass += gkCalibrationPINDiodeQECT1Error*gkCalibrationPINDiodeQECT1Error844 fMeanFluxOutsidePlexiglass /= gkCalibrationPINDiodeQECT1; 845 fMeanFluxErrOutsidePlexiglass += gkCalibrationPINDiodeQECT1Error*gkCalibrationPINDiodeQECT1Error 877 846 / gkCalibrationPINDiodeQECT1/gkCalibrationPINDiodeQECT1; 878 847 break; … … 881 850 882 851 *fLog << inf << endl; 883 *fLog << inf << " Mean number of Photons for an Inner Pixel (outside Plexiglass): "884 << fMean PhotOutsidePlexiglass << endl;885 886 if (fMean PhotOutsidePlexiglass > 0.)887 SETBIT(fFlags,k NumPhotOutsidePlexiglassAvailable);852 *fLog << inf << " Mean Photon flux [ph/cm^2] outside Plexiglass: " 853 << fMeanFluxOutsidePlexiglass << endl; 854 855 if (fMeanFluxOutsidePlexiglass > 0.) 856 SETBIT(fFlags,kFluxOutsidePlexiglassAvailable); 888 857 else 889 858 { 890 CLRBIT(fFlags,k NumPhotOutsidePlexiglassAvailable);859 CLRBIT(fFlags,kFluxOutsidePlexiglassAvailable); 891 860 return kFALSE; 892 861 } 893 862 894 if (fMean PhotErrOutsidePlexiglass < 0.)895 { 896 *fLog << warn << "Relative Variance on number of Photons for an Inner Pixel (outside Plexiglass): "897 << fMean PhotErrOutsidePlexiglass << endl;898 CLRBIT(fFlags,k NumPhotOutsidePlexiglassAvailable);863 if (fMeanFluxErrOutsidePlexiglass < 0.) 864 { 865 *fLog << warn << "Relative Variance on Photon flux outside Plexiglass: " 866 << fMeanFluxErrOutsidePlexiglass << endl; 867 CLRBIT(fFlags,kFluxOutsidePlexiglassAvailable); 899 868 return kFALSE; 900 869 } 901 870 902 871 // Finish calculation of errors -> convert from relative variance to absolute error 903 fMean PhotErrOutsidePlexiglass = TMath::Sqrt(fMeanPhotErrOutsidePlexiglass);904 fMean PhotErrOutsidePlexiglass *= fMeanPhotOutsidePlexiglass;905 906 *fLog << inf << " Error on number of Photons for an Inner Pixel (outside Plexiglass): "907 << fMean PhotErrOutsidePlexiglass << endl;872 fMeanFluxErrOutsidePlexiglass = TMath::Sqrt(fMeanFluxErrOutsidePlexiglass); 873 fMeanFluxErrOutsidePlexiglass *= fMeanFluxOutsidePlexiglass; 874 875 *fLog << inf << " Error on Photon flux [ph/cm^2] outside Plexiglass: " 876 << fMeanFluxErrOutsidePlexiglass << endl; 908 877 *fLog << inf << endl; 909 878 … … 916 885 { 917 886 887 const Int_t idx = pix->GetPixId(); 888 918 889 const Float_t charge = pix->GetCharge(); 919 const Float_t ratio = fGeomCam->GetPixRatio(pix->GetPixId());890 const Float_t area = (*fGeomCam)[idx].GetA()/100.; 920 891 const Float_t chargeerr = pix->GetErrCharge(); 921 892 922 Float_t nphot; 923 Float_t nphoterr; 924 925 if (ratio == 1.) 926 { 927 nphot = fMeanPhotInsidePlexiglass; 928 nphoterr = fMeanPhotErrInsidePlexiglass; 929 } 930 else 931 { 932 nphot = fMeanPhotInsidePlexiglass*gkCalibrationOutervsInnerPixelArea; 933 nphoterr = fMeanPhotErrInsidePlexiglass*gkCalibrationOutervsInnerPixelArea 934 *fMeanPhotErrInsidePlexiglass*gkCalibrationOutervsInnerPixelArea; 935 nphoterr += fMeanPhotInsidePlexiglass*gkCalibrationOutervsInnerPixelAreaError 936 *fMeanPhotInsidePlexiglass*gkCalibrationOutervsInnerPixelAreaError; 937 nphoterr = TMath::Sqrt(nphoterr); 938 } 939 940 const Float_t conversion = nphot/charge; 893 const Float_t nphot = fMeanFluxOutsidePlexiglass*area; 894 const Float_t nphoterr = fMeanFluxErrOutsidePlexiglass*area; 895 const Float_t conversion = nphot/charge; 896 941 897 Float_t conversionerr; 942 898 … … 951 907 const Float_t conversionsigma = 0.; 952 908 953 pix->SetConversion BlindPixelMethod(conversion, conversionerr, conversionsigma);909 pix->SetConversionPINDiodeMethod(conversion, conversionerr, conversionsigma); 954 910 955 911 if (conversionerr/conversion < 0.1) 956 pix->Set BlindPixelMethodValid();912 pix->SetPINDiodeMethodValid(); 957 913 958 914 } … … 969 925 return kFALSE; 970 926 971 if (!Is NumPhotInsidePlexiglassAvailable())972 if (!Calc NumPhotInsidePlexiglass())927 if (!IsFluxInsidePlexiglassAvailable()) 928 if (!CalcFluxInsidePlexiglass()) 973 929 return kFALSE; 974 930 … … 1014 970 return kFALSE; 1015 971 1016 if (!Is NumPhotOutsidePlexiglassAvailable())1017 if (!Calc NumPhotOutsidePlexiglass())972 if (!IsFluxOutsidePlexiglassAvailable()) 973 if (!CalcFluxOutsidePlexiglass()) 1018 974 return kFALSE; 1019 975 -
trunk/MagicSoft/Mars/mcalib/MCalibrationCam.h
r3073 r3075 37 37 TH2D* fOffvsSlope; //! 38 38 39 Float_t fMean PhotInsidePlexiglass; // The mean number of photons in an INNER PIXEL inside the plexiglass40 Float_t fMean PhotErrInsidePlexiglass; // The uncertainty about the number of photons in an INNER PIXEL41 Float_t fMean PhotOutsidePlexiglass; // The mean number of photons in an INNER PIXEL outside the plexiglass42 Float_t fMean PhotErrOutsidePlexiglass; // The uncertainty about the number of photons in an INNER PIXEL39 Float_t fMeanFluxInsidePlexiglass; // The mean number of photons in an INNER PIXEL inside the plexiglass 40 Float_t fMeanFluxErrInsidePlexiglass; // The uncertainty about the number of photons in an INNER PIXEL 41 Float_t fMeanFluxOutsidePlexiglass; // The mean number of photons in an INNER PIXEL outside the plexiglass 42 Float_t fMeanFluxErrOutsidePlexiglass; // The uncertainty about the number of photons in an INNER PIXEL 43 43 44 44 UInt_t fNumExcludedPixels; … … 47 47 48 48 enum { kBlindPixelMethodValid, kPINDiodeMethodValid, 49 k NumPhotInsidePlexiglassAvailable, kNumPhotOutsidePlexiglassAvailable };49 kFluxInsidePlexiglassAvailable, kFluxOutsidePlexiglassAvailable }; 50 50 51 51 public: … … 83 83 MCalibrationPINDiode *GetPINDiode() { return fPINDiode; } 84 84 85 Float_t GetMean PhotInsidePlexiglass() const { return fMeanPhotInsidePlexiglass; }86 Float_t GetMean PhotErrInsidePlexiglass() const { return fMeanPhotErrInsidePlexiglass; }87 Float_t GetMean PhotOutsidePlexiglass() const { return fMeanPhotOutsidePlexiglass; }88 Float_t GetMean PhotErrOutsidePlexiglass() const { return fMeanPhotErrOutsidePlexiglass; }85 Float_t GetMeanFluxInsidePlexiglass() const { return fMeanFluxInsidePlexiglass; } 86 Float_t GetMeanFluxErrInsidePlexiglass() const { return fMeanFluxErrInsidePlexiglass; } 87 Float_t GetMeanFluxOutsidePlexiglass() const { return fMeanFluxOutsidePlexiglass; } 88 Float_t GetMeanFluxErrOutsidePlexiglass() const { return fMeanFluxErrOutsidePlexiglass; } 89 89 90 90 Bool_t GetConversionFactorFFactor(Int_t ipx, Float_t &mean, Float_t &err, Float_t &sigma); … … 99 99 Bool_t IsPINDiodeMethodValid() const; 100 100 101 Bool_t Is NumPhotInsidePlexiglassAvailable() const;102 Bool_t Is NumPhotOutsidePlexiglassAvailable() const;101 Bool_t IsFluxInsidePlexiglassAvailable() const; 102 Bool_t IsFluxOutsidePlexiglassAvailable() const; 103 103 104 104 // Others … … 119 119 Bool_t GetPixelContent(Double_t &val, Int_t idx, const MGeomCam &cam, Int_t type=0) const; 120 120 121 Bool_t Calc NumPhotInsidePlexiglass();122 Bool_t Calc NumPhotOutsidePlexiglass();121 Bool_t CalcFluxInsidePlexiglass(); 122 Bool_t CalcFluxOutsidePlexiglass(); 123 123 124 124 ClassDef(MCalibrationCam, 1) // Container for calibration information of the camera -
trunk/MagicSoft/Mars/mcalib/MCalibrationConfig.h
r3065 r3075 36 36 const Float_t gkCalibrationBlindPixelAttCT1 = 1.95; 37 37 38 //39 // Area of Inner Pixel w.r.t. Blind Pixel (which is 1 sq. cm)40 //41 // Hexagone of diagonal axis b = 3.5 cm42 // straight axis a = 3.0 cm +- 2%43 // Area = sqrt(3)*a*a/2 = 7.79 sq.cm +- 4% = 7.8 +- 0.3 sq.cm44 //45 const Float_t gkCalibrationInnerPixelArea = 7.8;46 const Float_t gkCalibrationInnerPixelAreaError = 0.3;47 //48 // Area of Outer Pixel w.r.t. Inner Pixel49 //50 // Hexagone of diagonal axis b = 7.0 cm51 // straight axis a = 6.0 cm +- 1%52 // Area = sqrt(3)*a*a/2 = 31.177 sq.cm +- 2% = 31.2 +- 0.6 sq.cm53 //54 38 const Float_t gkCalibrationOutervsInnerPixelArea = 4.0; 55 39 const Float_t gkCalibrationOutervsInnerPixelAreaError = 0.2; … … 77 61 // C = 0.05 +- 0.02 78 62 // 79 const Float_t gkCalibration InnerPixelvsPINDiodeArea= 0.05;80 const Float_t gkCalibration InnerPixelvsPINDiodeAreaError = 0.02;63 const Float_t gkCalibrationFluxCameravsPINDiode = 0.05; 64 const Float_t gkCalibrationFluxCameravsPINDiodeError = 0.02; 81 65 82 66 // -
trunk/MagicSoft/Mars/mcalib/MHCalibrationBlindPixel.cc
r3061 r3075 289 289 fPSDExpFit->SetParNames("Area","slope"); 290 290 fPSDExpFit->SetParLimits(0,0.,3.*area_guess); 291 fPSDExpFit->SetParLimits(1, 5.,20.);291 fPSDExpFit->SetParLimits(1,0.,20.); 292 292 fPSDExpFit->SetRange(fMinFreq,fNyquistFreq); 293 293 -
trunk/MagicSoft/Mars/mcalib/MHCalibrationPixel.cc
r3074 r3075 61 61 const Int_t MHCalibrationPixel::fNDFLimit = 5; 62 62 63 const Axis_t MHCalibrationPixel::fMaxFreq = 30.5;64 63 const Axis_t MHCalibrationPixel::fMinFreq = 0.; 65 const Int_t MHCalibrationPixel::fPSDNbins = 30;64 const Int_t MHCalibrationPixel::fPSDNbins = 50; 66 65 67 66 // -------------------------------------------------------------------------- … … 260 259 // 261 260 262 // This cuts only the non-used zero's, but MFFT will cut the rest261 // This cuts only the non-used zero's, but MFFT will later cut the rest 263 262 CutArrayBorder(fHiGains); 264 263 CutArrayBorder(fLoGains); 265 264 266 267 265 MFFT fourier; 268 266 … … 272 270 Int_t entries; 273 271 TArrayF *array; 274 272 273 const Double_t max_freq = (fChargeSigma > 0.) ? fChargeSigma*0.2 : 2.; 274 const Double_t min_freq = 0.; 275 275 276 if (IsUseLoGain()) 276 277 { 277 278 fHPSD = new TH1F(Form("%s%d","HPSD",fPixId), 278 279 Form("%s%s","Power Spectrum Density Projection ","LoGain"), 279 fPSDNbins, fMinFreq,fMaxFreq);280 fPSDNbins,min_freq,max_freq); 280 281 281 282 array = fPSDLoGain; … … 286 287 fHPSD = new TH1F(Form("%s%d","HPSD",fPixId), 287 288 Form("%s%s","Power Spectrum Density Projection ","HiGain"), 288 fPSDNbins, fMinFreq,fMaxFreq);289 fPSDNbins,min_freq,max_freq); 289 290 290 291 array = fPSDHiGain; … … 305 306 fPSDExpFit->SetParameters(area_guess,10.); 306 307 fPSDExpFit->SetParNames("Area","slope"); 307 fPSDExpFit->SetParLimits(0,0., 3.*area_guess);308 fPSDExpFit->SetParLimits(1,0., 20.);309 fPSDExpFit->SetRange( fMinFreq,fMaxFreq);308 fPSDExpFit->SetParLimits(0,0.,20.*area_guess); 309 fPSDExpFit->SetParLimits(1,0.,30.); 310 fPSDExpFit->SetRange(min_freq,max_freq); 310 311 311 312 fHPSD->Fit(fPSDExpFit,"RQL0"); … … 351 352 352 353 const Int_t diff = fChargeXaxis->GetSize()-n; 354 353 355 fChargeXaxis->Set(n); 354 356 if (diff < 0) 355 for (Int_t i=n ;i<n+diff;i++)357 for (Int_t i=n-1;i>n-diff-1;i--) 356 358 fChargeXaxis->AddAt((Float_t)i,i); 357 359 } … … 582 584 583 585 TCanvas *c = MH::MakeDefCanvas(this,600,900); 586 c->SetBit(kCanDelete); 584 587 585 588 c->Divide(2,5); … … 714 717 715 718 gStyle->SetOptStat(111111); 719 gStyle->SetOptFit(); 716 720 gPad->SetTicks(); 717 721 … … 729 733 c->Modified(); 730 734 c->Update(); 735 736 c->Iconify(); 731 737 732 738 return; -
trunk/MagicSoft/Mars/mcalib/MHCalibrationPixel.h
r3073 r3075 26 26 static const Int_t fNDFLimit; 27 27 28 static const Axis_t fMaxFreq;29 28 static const Axis_t fMinFreq; 30 29 static const Int_t fPSDNbins;
Note:
See TracChangeset
for help on using the changeset viewer.