- Timestamp:
- 07/01/08 17:07:30 (16 years ago)
- Location:
- trunk/MagicSoft/Mars
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/Changelog
r8989 r8990 74 74 - initialize fNsb* members also in PreProcess as correctly 75 75 suggested by valgrind 76 77 * mjobs/MJCalibration.[h,cc]: 78 - made the drawing of the bad pixel explanation more automatic 79 - some simplifications to the function drawing all the result tabs 80 - make sure to do the projection without name. Some root versions 81 don't like several plots with the same name in one tab 82 - removed several misleading drawing of number of outliers etc 83 - added setting of min and max to FixDataCheckHist 84 - simplified DisplayDoubleProjection (also unified in code with 85 MJPedestal) 86 - removed all the obsolste and confusing projections of the 87 individual sectors and camera halves 88 89 * mjobs/MJPedestal.[h,cc]: 90 - make sure to do the projection without name. Some root versions 91 don't like several plots with the same name in one tab 92 - use the unified DisplayDoubleProjection from MJCalibration 93 - removed all the obsolste and confusing projections of the 94 individual sectors and camera halves 76 95 77 96 -
trunk/MagicSoft/Mars/mjobs/MJCalibration.cc
r8986 r8990 227 227 fRefTimeResolutionInner = 0.12; 228 228 fRefTimeResolutionOuter = 0.09; 229 230 229 } 231 230 … … 240 239 } 241 240 242 void MJCalibration::DrawBadPixel(TPaveText &pave, const MHCamera &h, Int_t n, Float_t f, const char *str) const241 MHCamera *MJCalibration::DrawBadPixelPad(const MHCamera &h, Bool_t unsuit) const 243 242 { 244 Int_t cnt = 0; 245 for (UInt_t pix=0; pix<h.GetNumPixels(); pix++) 246 if (TMath::Nint(h.GetPixContent(pix)) == n) 247 cnt++; 248 249 const TString txt = Form(n<10?" %d) %s%3i pixels":"%d) %s%3i pixels", n, str, cnt); 250 251 TText *p = pave.AddText(txt); 252 p->SetTextColor(gStyle->GetColorPalette(TMath::FloorNint((n-1)*f))); 253 p->SetTextAlign(12); 243 MHCamera *obj=(MHCamera*)h.DrawCopy("hist"); 244 245 gStyle->SetPalette(1); 246 247 const Int_t numcol = gStyle->GetNumberOfColors(); 248 249 const Double_t min = 1; 250 const Double_t max = unsuit ? MBadPixelsPix::GetNumUnsuitable() : MBadPixelsPix::GetNumUnreliable(); 251 const Double_t f = (numcol-1)/(max-min); 252 253 FixDataCheckHist(*obj, min, max); 254 255 TPaveText *pave = new TPaveText(0.05, 0.012, 0.975, 0.999); 256 257 const Double_t height = (pave->GetY2()-pave->GetY1())/(max+1); 258 259 pave->SetBit(kCanDelete); 260 pave->ConvertNDCtoPad(); 261 pave->SetFillColor(14); 262 pave->Draw(); 263 264 Int_t n=0; 265 while (1) 266 { 267 const TString name = unsuit ? MBadPixelsPix::GetUnsuitableName(++n) : MBadPixelsPix::GetUnreliableName(++n); 268 if (name.IsNull()) 269 break; 270 271 Int_t cnt = 0; 272 for (UInt_t pix=0; pix<h.GetNumPixels(); pix++) 273 if (TMath::Nint(h.GetPixContent(pix)) == n) 274 cnt++; 275 276 const TString loc = unsuit?MBadPixelsPix::GetUnsuitableName(n):MBadPixelsPix::GetUnreliableName(n); 277 278 const TString left = Form("%d) %s", n, loc.Data()); 279 const TString right = Form("%3i pixels", cnt); 280 281 const Int_t col = gStyle->GetColorPalette(TMath::FloorNint((n-1)*f)); 282 283 TText *p = pave->AddText(0.05, pave->GetY2()-height*(n+0.3), left); 284 p->SetTextColor(col); 285 p->SetTextAlign(12); 286 287 p = pave->AddText(0.95, p->GetY(), right); 288 p->SetTextColor(col); 289 p->SetTextAlign(32); 290 } 291 292 return obj; 254 293 } 255 294 … … 365 404 MHCamera disp36(geomcam, "RMSperMean", "Charge histogram RMS per Mean"); 366 405 MHCamera disp37(geomcam, "TotalConvPhe", "Conversion Factor to equiv. Phe's"); 367 406 368 407 // Fitted charge means and sigmas 369 408 disp1.SetCamContent(fCalibrationCam, 0); … … 484 523 const Float_t convphe = pix.GetMeanConvFADC2Phe(); 485 524 const Float_t quaeff = qe.GetQECascadesFFactor(); 486 525 487 526 disp35.Fill(i,convphe/quaeff); 488 527 disp35.SetUsed(i); … … 502 541 disp33.SetCamContent(fBadPixels, 20); 503 542 disp34.SetCamContent(fBadPixels, 21); 504 543 505 544 disp30.SetYTitle("Time Offset [FADC units]"); 506 545 disp31.SetYTitle("Timing resolution [FADC units]"); … … 512 551 if (fDisplayType == kDataCheckDisplay) 513 552 { 514 553 515 554 TCanvas &c1 = fDisplay->AddTab("FitCharge"); 516 555 c1.Divide(3, 3); 517 556 518 557 // 519 558 // MEAN CHARGES 520 559 // 521 522 560 c1.cd(1); 523 561 gPad->SetBorderMode(0); 524 562 gPad->SetTicks(); 525 563 MHCamera *obj1=(MHCamera*)disp1.DrawCopy("hist"); 526 // 527 // for the datacheck, fix the ranges!! 528 // 529 // obj1->SetMinimum(fChargeMin); 530 // obj1->SetMaximum(fChargeMax); 531 // 532 // Set the datacheck sizes: 533 // 534 FixDataCheckHist((TH1D*)obj1); 535 obj1->SetStats(kFALSE); 536 // 537 // set reference lines 538 // 539 // DisplayReferenceLines(obj1,0); 540 564 FixDataCheckHist(*obj1/*, fChargeMin, fChargeMax*/); 565 // DisplayReferenceLines(obj1,0); 566 541 567 c1.cd(4); 542 568 gPad->SetBorderMode(0); 543 569 obj1->SetPrettyPalette(); 544 570 obj1->Draw(); 545 571 546 572 c1.cd(7); 547 573 gPad->SetBorderMode(0); 548 574 gPad->SetTicks(); 549 TH1D *obj2 = (TH1D*)obj1->Projection(obj1->GetName()); 575 TH1D *obj2 = (TH1D*)obj1->Projection(); 576 obj2->SetBit(kCanDelete); 550 577 obj2->Draw(); 551 obj2->SetBit(kCanDelete); 552 obj2->Fit("gaus","Q"); 553 TF1 *fun2 = obj2->GetFunction("gaus"); 554 fun2->SetLineColor(kYellow); 555 gPad->Modified(); 556 gPad->Update(); 557 TPaveStats *st = (TPaveStats*)obj2->GetListOfFunctions()->FindObject("stats"); 558 st->SetY1NDC(0.55); 559 st->SetY2NDC(0.89); 560 st->SetX1NDC(0.65); 561 st->SetX2NDC(0.99); 562 gPad->Modified(); 563 gPad->Update(); 564 // 565 // Set the datacheck sizes: 566 // 567 FixDataCheckHist(obj2); 568 obj2->SetStats(1); 569 570 // 571 // Display the outliers as dead and noisy pixels 572 // 573 DisplayOutliers(obj2,"low-ampl.","high-ampl."); 574 TLatex flattex; 575 flattex.SetTextSize(0.07); 576 const Double_t minl = obj2->GetBinCenter(obj2->GetXaxis()->GetFirst()); 577 const Double_t maxl = obj2->GetBinCenter(obj2->GetXaxis()->GetLast()); 578 flattex.DrawLatex(minl+0.015*(maxl-minl),obj2->GetBinContent(obj2->GetMaximumBin())/1.35, 579 Form("Flatfield precision: %4.2f%%", 580 fun2->GetParameter(2)/fun2->GetParameter(1)*100.)); 581 578 FixDataCheckHist(*obj2); 579 //obj2->SetStats(1); 580 582 581 // 583 582 // RMS per Charge 584 583 // 585 586 584 c1.cd(2); 587 585 gPad->SetBorderMode(0); 588 586 gPad->SetTicks(); 589 587 MHCamera *obj3=(MHCamera*)disp36.DrawCopy("hist"); 590 // 591 // for the datacheck, fix the ranges!! 592 // 593 // obj3->SetMinimum(0.); 594 // obj3->SetMaximum(fChargeMax); 595 // 596 // Set the datacheck sizes: 597 // 598 FixDataCheckHist((TH1D*)obj3); 599 obj3->SetStats(kFALSE); 600 // 601 // set reference lines 602 // 603 // DisplayReferenceLines(obj3,0); 604 588 FixDataCheckHist(*obj3/*, 0, fChargeMax*/); 589 // DisplayReferenceLines(obj3,0); 590 605 591 c1.cd(5); 606 592 gPad->SetBorderMode(0); 607 593 obj3->SetPrettyPalette(); 608 594 obj3->Draw(); 609 595 610 596 c1.cd(8); 611 597 gPad->SetBorderMode(0); 612 598 if (geomcam.InheritsFrom("MGeomCamMagic")) 613 DisplayDoubleProject(&disp36, "dead", "noisy");614 599 DisplayDoubleProject(disp36/*, "dead", "noisy"*/); 600 615 601 // 616 602 // PHOTO ELECTRONS 617 603 // 618 619 604 c1.cd(3); 620 605 gPad->SetBorderMode(0); 621 606 gPad->SetTicks(); 622 607 MHCamera *obj4=(MHCamera*)disp5.DrawCopy("hist"); 623 // 624 // for the datacheck, fix the ranges!! 625 // 626 // obj3->SetMinimum(fChargeMin); 627 // obj3->SetMaximum(fChargeMax); 628 // 629 // Set the datacheck sizes: 630 // 631 FixDataCheckHist((TH1D*)obj4); 632 obj4->SetStats(kFALSE); 633 // 634 // set reference lines 635 // 636 // DisplayReferenceLines(obj3,0); 637 608 FixDataCheckHist(*obj4/*, fChargeMin, fChargeMax*/); 609 // DisplayReferenceLines(obj3,0); 610 638 611 c1.cd(6); 639 612 gPad->SetBorderMode(0); 640 613 obj4->SetPrettyPalette(); 641 614 obj4->Draw(); 642 615 643 616 c1.cd(9); 644 617 gPad->SetBorderMode(0); 645 618 if (geomcam.InheritsFrom("MGeomCamMagic")) 646 DisplayDoubleProject(&disp5, "dead", "noisy");647 619 DisplayDoubleProject(disp5/*, "dead", "noisy"*/); 620 648 621 // 649 622 // CONVERSION FACTORS … … 651 624 TCanvas &c2 = fDisplay->AddTab("Conversion"); 652 625 c2.Divide(3,3); 653 626 654 627 c2.cd(1); 655 628 gPad->SetBorderMode(0); 656 629 gPad->SetTicks(); 657 630 MHCamera *obj5=(MHCamera*)disp6.DrawCopy("hist"); 658 // 659 // for the datacheck, fix the ranges!! 660 // 661 obj5->SetMinimum(fConvFADC2PheMin); 662 obj5->SetMaximum(fConvFADC2PheMax); 663 // 664 // Set the datacheck sizes: 665 // 666 FixDataCheckHist((TH1D*)obj5); 667 obj5->SetStats(kFALSE); 668 // 669 // set reference lines 670 // 631 FixDataCheckHist(*obj5, fConvFADC2PheMin, fConvFADC2PheMax); 671 632 DisplayReferenceLines(obj5,2); 672 633 673 634 c2.cd(4); 674 635 gPad->SetBorderMode(0); 675 636 obj5->SetPrettyPalette(); 676 637 obj5->Draw(); 677 638 678 639 c2.cd(7); 679 640 gPad->SetBorderMode(0); 680 641 if (geomcam.InheritsFrom("MGeomCamMagic")) 681 DisplayDoubleProject(&disp6, "noisy", "dead");682 642 DisplayDoubleProject(disp6/*, "noisy", "dead"*/); 643 683 644 // 684 645 // QUANTUM EFFICIENCY … … 688 649 gPad->SetTicks(); 689 650 MHCamera *obj6=(MHCamera*)disp8.DrawCopy("hist"); 690 // 691 // for the datacheck, fix the ranges!! 692 // 693 obj6->SetMinimum(fQEMin); 694 obj6->SetMaximum(fQEMax); 695 // 696 // Set the datacheck sizes: 697 // 698 FixDataCheckHist((TH1D*)obj6); 699 obj6->SetStats(kFALSE); 700 // 701 // set reference lines 702 // 651 FixDataCheckHist(*obj6, fQEMin, fQEMax); 703 652 DisplayReferenceLines(obj6,0); 704 653 705 654 c2.cd(5); 706 655 gPad->SetBorderMode(0); 707 656 obj6->SetPrettyPalette(); 708 657 obj6->Draw(); 709 658 710 659 c2.cd(8); 711 660 gPad->SetBorderMode(0); 712 661 if (geomcam.InheritsFrom("MGeomCamMagic")) 713 DisplayDoubleProject(&disp8, "noisy", "dead");714 662 DisplayDoubleProject(disp8/*, "noisy", "dead"*/); 663 715 664 // 716 665 // CONVERSION FADC TO PHOTONS 717 666 // 718 719 667 c2.cd(3); 720 668 gPad->SetBorderMode(0); 721 669 gPad->SetTicks(); 722 670 MHCamera *obj7=(MHCamera*)disp37.DrawCopy("hist"); 723 // 724 // for the datacheck, fix the ranges!! 725 // 726 obj7->SetMinimum(fConvFADC2PheMin); 727 obj7->SetMaximum(fConvFADC2PheMax); 728 // 729 // Set the datacheck sizes: 730 // 731 FixDataCheckHist((TH1D*)obj7); 732 obj7->SetStats(kFALSE); 733 // 734 // set reference lines 735 // 671 FixDataCheckHist(*obj7, fConvFADC2PheMin, fConvFADC2PheMax); 736 672 DisplayReferenceLines(obj7,1); 737 673 738 674 c2.cd(6); 739 675 gPad->SetBorderMode(0); … … 743 679 gPad->SetBorderMode(0); 744 680 if (geomcam.InheritsFrom("MGeomCamMagic")) 745 DisplayDoubleProject(&disp37, "noisy", "dead");681 DisplayDoubleProject(disp37/*, "noisy", "dead"*/); 746 682 747 683 // … … 750 686 TCanvas &c3 = fDisplay->AddTab("AbsTimes"); 751 687 c3.Divide(2,3); 752 688 753 689 c3.cd(1); 754 690 gPad->SetBorderMode(0); 755 691 gPad->SetTicks(); 756 692 MHCamera *obj10=(MHCamera*)disp28.DrawCopy("hist"); 757 // 758 // for the datacheck, fix the ranges!! 759 // 760 obj10->SetMinimum(fArrivalTimeMin); 761 obj10->SetMaximum(fArrivalTimeMax); 762 // 763 // Set the datacheck sizes: 764 // 765 FixDataCheckHist((TH1D*)obj10); 766 obj10->SetStats(kFALSE); 767 // 768 // set reference lines 769 // 693 FixDataCheckHist(*obj10, fArrivalTimeMin, fArrivalTimeMax); 770 694 DisplayReferenceLines(obj10,3); 771 695 772 696 c3.cd(3); 773 697 gPad->SetBorderMode(0); 774 698 obj10->SetPrettyPalette(); 775 699 obj10->Draw(); 776 700 777 701 c3.cd(5); 778 702 gPad->SetBorderMode(0); 779 703 if (geomcam.InheritsFrom("MGeomCamMagic")) 780 DisplayDoubleProject(&disp28, "early", "late");704 DisplayDoubleProject(disp28/*, "early", "late"*/); 781 705 782 706 // … … 787 711 gPad->SetTicks(); 788 712 MHCamera *obj11=(MHCamera*)disp29.DrawCopy("hist"); 789 // 790 // for the datacheck, fix the ranges!! 791 // 792 // obj11->SetMinimum(fArrivalTimeMin); 793 // obj11->SetMaximum(fArrivalTimeMax); 794 // 795 // Set the datacheck sizes: 796 // 797 FixDataCheckHist((TH1D*)obj11); 798 obj11->SetStats(kFALSE); 799 // 800 // set reference lines 801 // 713 FixDataCheckHist(*obj11/*, fArrivalTimeMin, fArrivalTimeMax*/); 802 714 DisplayReferenceLines(obj11,4); 803 715 804 716 c3.cd(4); 805 717 gPad->SetBorderMode(0); 806 718 obj11->SetPrettyPalette(); 807 719 obj11->Draw(); 808 720 809 721 c3.cd(6); 810 722 gPad->SetBorderMode(0); 811 723 if (geomcam.InheritsFrom("MGeomCamMagic")) 812 DisplayDoubleProject(&disp29, "", "jittering");724 DisplayDoubleProject(disp29/*, "", "jittering"*/); 813 725 814 726 // … … 822 734 gPad->SetTicks(); 823 735 824 MHCamera *obj8=(MHCamera*)disp24.DrawCopy("hist"); 825 826 gStyle->SetPalette(1); 827 const Int_t numcol = gStyle->GetNumberOfColors(); 828 829 const Double_t min = 1; 830 const Double_t max = 10.; 831 const Double_t f = (numcol-1)/(max-min); 832 833 obj8->SetStats(kFALSE); 834 obj8->SetMinimum(min); 835 obj8->SetMaximum(max); 836 837 // 838 // Set the datacheck sizes: 839 // 840 FixDataCheckHist((TH1D*)obj8); 841 842 TPaveText *pave = new TPaveText(0.05,0.02,0.975,0.999); 843 pave->SetBit(kCanDelete); 844 pave->ConvertNDCtoPad(); 845 pave->SetTextSize(0.045); 846 pave->SetFillColor(14); 847 pave->AddText(" "); 848 DrawBadPixel(*pave, disp24, 1, f, "Signal smaller 4.5 Pedestal RMS: "); 849 DrawBadPixel(*pave, disp24, 2, f, "Low Gain Saturation: "); 850 // DrawBadPixel(*pave, disp24, 3, f, "Mean Arr. Time In First Extraction Bin: "); 851 // DrawBadPixel(*pave, disp24, 4, f, "Mean Arr. Time In Last 2 Extraction Bins: "); 852 DrawBadPixel(*pave, disp24, 3, f, "High-Gain Histogram Overflow: "); 853 DrawBadPixel(*pave, disp24, 4, f, "Low-Gain Histogram Overflow: "); 854 DrawBadPixel(*pave, disp24, 5, f, "Presumably dead from Ped. Rms: "); 855 DrawBadPixel(*pave, disp24, 6, f, "Deviating Number of Photo-electrons: "); 856 DrawBadPixel(*pave, disp24, 7, f, "Deviation from median abs.arr-time rms: "); 857 DrawBadPixel(*pave, disp24, 8, f, "Deviation from median rel.arr-time rms: "); 858 DrawBadPixel(*pave, disp24, 9, f, "Too many Low-Gain Blackout Events: "); 859 DrawBadPixel(*pave, disp24, 10, f, "Previously Excluded: "); 860 pave->Draw(); 736 MHCamera *obj8 = DrawBadPixelPad(disp24, kTRUE); 861 737 862 738 c4.cd(3); … … 871 747 gPad->SetBorderMode(0); 872 748 gPad->SetTicks(); 873 MHCamera *obj9=(MHCamera*)disp25.DrawCopy("hist"); 874 875 const Double_t min2 = 1; 876 const Double_t max2 = 8; 877 const Double_t f2 = (numcol-1)/(max2-min2); 878 obj9->SetMinimum(min2); 879 obj9->SetMaximum(max2); 880 obj9->SetStats(kFALSE); 881 882 FixDataCheckHist((TH1D*)obj9); 883 884 gStyle->SetPalette(1); 885 886 TPaveText *pave2 = new TPaveText(0.025,0.02,0.95,0.999); 887 pave2->SetBit(kCanDelete); 888 pave2->ConvertNDCtoPad(); 889 pave2->SetTextSize(0.05); 890 pave2->SetFillColor(14); 891 pave2->AddText(" "); 892 DrawBadPixel(*pave2, disp25, 1, f2, "Signal Sigma smaller Pedestal RMS: "); 893 DrawBadPixel(*pave2, disp25, 2, f2, "High Gain Signals could not be fitted: "); 894 DrawBadPixel(*pave2, disp25, 3, f2, "Low Gain Signals could not be fitted: "); 895 DrawBadPixel(*pave2, disp25, 4, f2, "Relative Arr. Times could not be fitted: "); 896 DrawBadPixel(*pave2, disp25, 5, f2, "High Gain Signals Oscillation: "); 897 DrawBadPixel(*pave2, disp25, 6, f2, "Low Gain Signals Oscillation: "); 898 DrawBadPixel(*pave2, disp25, 7, f2, "Relative Arr. Times Oscillation: "); 899 DrawBadPixel(*pave2, disp25, 8, f2, "Deviating global F-Factor: "); 900 pave2->Draw(); 749 750 MHCamera *obj9 = DrawBadPixelPad(disp25, kFALSE); 901 751 902 752 c4.cd(4); … … 909 759 TCanvas &c5 = fDisplay->AddTab("RelTimes"); 910 760 c5.Divide(2,3); 911 761 912 762 // 913 763 // MEAN REL. ARR. TIMES … … 917 767 gPad->SetTicks(); 918 768 MHCamera *obj12=(MHCamera*)disp30.DrawCopy("hist"); 919 // 920 // for the datacheck, fix the ranges!! 921 // 922 obj12->SetMinimum(fTimeOffsetMin); 923 obj12->SetMaximum(fTimeOffsetMax); 924 // 925 // Set the datacheck sizes: 926 // 927 FixDataCheckHist((TH1D*)obj12); 928 obj12->SetStats(kFALSE); 929 // 930 // set reference lines 931 // 769 FixDataCheckHist(*obj12, fTimeOffsetMin, fTimeOffsetMax); 932 770 DisplayReferenceLines(obj12,5); 933 771 934 772 c5.cd(3); 935 773 gPad->SetBorderMode(0); 936 774 obj10->SetPrettyPalette(); 937 775 obj10->Draw(); 938 776 939 777 c5.cd(5); 940 778 gPad->SetBorderMode(0); 941 779 if (geomcam.InheritsFrom("MGeomCamMagic")) 942 DisplayDoubleProject(&disp30, "early", "late");943 780 DisplayDoubleProject(disp30/*, "early", "late"*/); 781 944 782 // 945 783 // JITTER Rel. Arr. Times … … 949 787 gPad->SetTicks(); 950 788 MHCamera *obj13=(MHCamera*)disp31.DrawCopy("hist"); 951 // 952 // for the datacheck, fix the ranges!! 953 // 954 obj13->SetMinimum(fTimeResolutionMin); 955 obj13->SetMaximum(fTimeResolutionMax); 956 // 957 // Set the datacheck sizes: 958 // 959 FixDataCheckHist((TH1D*)obj13); 960 obj13->SetStats(kFALSE); 961 // 962 // set reference lines 963 // 789 FixDataCheckHist(*obj13, fTimeResolutionMin, fTimeResolutionMax); 964 790 DisplayReferenceLines(obj13,6); 965 791 966 792 c5.cd(4); 967 793 gPad->SetBorderMode(0); 968 794 obj13->SetPrettyPalette(); 969 795 obj13->Draw(); 970 796 971 797 c5.cd(6); 972 798 gPad->SetBorderMode(0); 973 799 if (geomcam.InheritsFrom("MGeomCamMagic")) 974 DisplayDoubleProject(&disp31, "too stable", "jittering");975 800 DisplayDoubleProject(disp31/*, "too stable", "jittering"*/); 801 976 802 } 977 803 return; 978 804 } 979 805 980 806 if (fDisplayType == kNormalDisplay) 981 807 { 982 808 983 809 // Charges 984 810 TCanvas &c11 = fDisplay->AddTab("FitCharge"); 985 811 c11.Divide(2, 4); 986 812 987 813 disp1.CamDraw(c11, 1, 2, 5, 1); 988 814 disp2.CamDraw(c11, 2, 2, 5, 1); 989 815 990 816 // Reduced Sigmas 991 817 TCanvas &c12 = fDisplay->AddTab("RedSigma"); 992 818 c12.Divide(2,4); 993 819 994 820 disp3.CamDraw(c12, 1, 2, 5, 1); 995 821 disp4.CamDraw(c12, 2, 2, 5, 1); 996 822 997 823 // F-Factor 998 824 TCanvas &c13 = fDisplay->AddTab("Phe's"); 999 825 c13.Divide(3,4); 1000 826 1001 827 disp5.CamDraw(c13, 1, 3, 5, 1); 1002 828 disp6.CamDraw(c13, 2, 3, 5, 1); 1003 829 disp7.CamDraw(c13, 3, 3, 5, 1); 1004 830 1005 831 // QE's 1006 832 TCanvas &c14 = fDisplay->AddTab("QE's"); 1007 833 c14.Divide(4,4); 1008 834 1009 835 disp8.CamDraw(c14, 1, 4, 5, 1); 1010 836 disp9.CamDraw(c14, 2, 4, 5, 1); 1011 837 disp10.CamDraw(c14, 3, 4, 5, 1); 1012 838 disp11.CamDraw(c14, 4, 4, 5, 1); 1013 839 1014 840 // Defects 1015 841 TCanvas &c15 = fDisplay->AddTab("Defect"); 1016 842 // c15.Divide(5,2); 1017 843 c15.Divide(4,2); 1018 844 1019 845 /* 1020 846 disp23.CamDraw(c15, 1, 5, 0); … … 1028 854 disp26.CamDraw(c15, 3, 4, 0); 1029 855 disp27.CamDraw(c15, 4, 4, 0); 1030 856 1031 857 // Abs. Times 1032 858 TCanvas &c16 = fDisplay->AddTab("AbsTimes"); 1033 859 c16.Divide(2,3); 1034 860 1035 861 disp28.CamDraw(c16, 1, 2, 5); 1036 862 disp29.CamDraw(c16, 2, 2, 5); … … 1045 871 disp31.CamDraw(c17, 2, 2, 5, 1); 1046 872 } 1047 873 1048 874 return; 1049 875 } 1050 876 1051 877 if (fDisplayType == kFullDisplay) 1052 878 { … … 1076 902 TCanvas &c24 = fDisplay->AddTab("Phe's"); 1077 903 c24.Divide(3,5); 1078 904 1079 905 disp5.CamDraw(c24, 1, 3, 2, 1, 1); 1080 906 disp6.CamDraw(c24, 2, 3, 2, 1, 1); 1081 907 disp7.CamDraw(c24, 3, 3, 2, 1, 1); 1082 908 1083 909 // QE's 1084 910 TCanvas &c25 = fDisplay->AddTab("QE's"); 1085 911 c25.Divide(4,5); 1086 912 1087 913 disp8.CamDraw(c25, 1, 4, 2, 1, 1); 1088 914 disp9.CamDraw(c25, 2, 4, 2, 1, 1); 1089 915 disp10.CamDraw(c25, 3, 4, 2, 1, 1); 1090 916 disp11.CamDraw(c25, 4, 4, 2, 1, 1); 1091 917 1092 918 // Validity 1093 919 TCanvas &c26 = fDisplay->AddTab("Valid"); 1094 920 c26.Divide(4,2); 1095 921 1096 922 disp12.CamDraw(c26, 1, 4, 0); 1097 923 disp13.CamDraw(c26, 2, 4, 0); 1098 924 disp14.CamDraw(c26, 3, 4, 0); 1099 925 disp15.CamDraw(c26, 4, 4, 0); 1100 926 1101 927 // Other info 1102 928 TCanvas &c27 = fDisplay->AddTab("HiLoGain"); … … 1106 932 disp17.CamDraw(c27, 2, 3, 1); 1107 933 disp18.CamDraw(c27, 3, 3, 1); 1108 934 1109 935 // Pickup 1110 936 TCanvas &c28 = fDisplay->AddTab("Pickup"); 1111 937 c28.Divide(4,2); 1112 938 1113 939 disp19.CamDraw(c28, 1, 4, 0); 1114 940 disp20.CamDraw(c28, 2, 4, 0); 1115 941 disp21.CamDraw(c28, 3, 4, 0); 1116 942 disp22.CamDraw(c28, 4, 4, 0); 1117 943 1118 944 // Defects 1119 945 TCanvas &c29 = fDisplay->AddTab("Defect"); 1120 946 // c29.Divide(5,2); 1121 947 c29.Divide(4,2); 1122 948 1123 949 disp24.CamDraw(c29, 1, 4, 0); 1124 950 disp25.CamDraw(c29, 2, 4, 0); 1125 951 disp26.CamDraw(c29, 3, 4, 0); 1126 952 disp27.CamDraw(c29, 4, 4, 0); 1127 953 1128 954 // Abs. Times 1129 955 TCanvas &c30 = fDisplay->AddTab("AbsTimes"); 1130 956 c30.Divide(2,3); 1131 957 1132 958 disp28.CamDraw(c30, 1, 2, 2); 1133 959 disp29.CamDraw(c30, 2, 2, 1); … … 1138 964 TCanvas &c31 = fDisplay->AddTab("RelTimes"); 1139 965 c31.Divide(3,5); 1140 966 1141 967 disp30.CamDraw(c31, 1, 3, 2, 1, 1); 1142 968 disp31.CamDraw(c31, 2, 3, 2, 1, 1); … … 1146 972 TCanvas &c32 = fDisplay->AddTab("DefTime"); 1147 973 c32.Divide(2,2); 1148 974 1149 975 disp33.CamDraw(c32, 1, 2, 0); 1150 976 disp34.CamDraw(c32, 2, 2, 0); 1151 977 1152 978 MHCalibrationCam *ccam = (MHCalibrationCam*)plist.FindObject("MHCalibrationRelTimeCam"); 1153 979 1154 980 for (Int_t sector=1;sector<ccam->GetAverageSectors();sector++) 1155 981 { … … 1165 991 1166 992 1167 void MJCalibration::DisplayReferenceLines( MHCamera *cam, const Int_t what) const993 void MJCalibration::DisplayReferenceLines(const MHCamera *cam, const Int_t what) const 1168 994 { 1169 995 … … 1176 1002 line.SetLineWidth(3); 1177 1003 line.SetLineColor(kBlue); 1178 1004 1179 1005 TLine *l1 = NULL; 1180 1006 … … 1237 1063 } 1238 1064 } 1239 1065 1240 1066 TLegend *leg = new TLegend(0.6,0.85,0.9 ,0.95); 1241 1067 leg->SetBit(kCanDelete); … … 1244 1070 } 1245 1071 1072 /* 1246 1073 void MJCalibration::DisplayOutliers(TH1D *hist, const char* whatsmall, const char* whatbig) const 1247 1074 { … … 1273 1100 1274 1101 } 1275 1276 void MJCalibration::FixDataCheckHist(TH1D *hist) const 1102 */ 1103 1104 void MJCalibration::FixDataCheckHist(TH1D &h, Double_t min, Double_t max) 1277 1105 { 1278 1279 hist->SetDirectory(NULL); 1106 h.SetDirectory(NULL); 1107 h.SetStats(kFALSE); 1108 h.SetMinimum(min); 1109 h.SetMaximum(max); 1280 1110 1281 1111 // 1282 1112 // set the labels bigger 1283 1113 // 1284 TAxis *xaxe = h ist->GetXaxis();1285 TAxis *yaxe = h ist->GetYaxis();1286 1114 TAxis *xaxe = h.GetXaxis(); 1115 TAxis *yaxe = h.GetYaxis(); 1116 1287 1117 xaxe->CenterTitle(); 1288 1118 yaxe->CenterTitle(); … … 1293 1123 xaxe->SetLabelSize(0.05); 1294 1124 yaxe->SetLabelSize(0.05); 1295 1296 1125 } 1297 1126 … … 1345 1174 { 1346 1175 TEnv refenv(fReferenceFile); 1347 1176 1348 1177 fConvFADC2PheMin = refenv.GetValue("ConvFADC2PheMin",fConvFADC2PheMin); 1349 1178 fConvFADC2PheMax = refenv.GetValue("ConvFADC2PheMax",fConvFADC2PheMax); … … 2048 1877 } 2049 1878 2050 void MJCalibration::DisplayDoubleProject( MHCamera *cam, const char* whatsmall, const char* whatbig) const1879 void MJCalibration::DisplayDoubleProject(const MHCamera &cam) 2051 1880 { 2052 2053 TArrayI inner(1); 2054 inner[0] = 0; 2055 2056 TArrayI outer(1); 2057 outer[0] = 1; 2058 2059 TArrayI s1(3); 2060 s1[0] = 6; 2061 s1[1] = 1; 2062 s1[2] = 2; 2063 2064 TArrayI s2(3); 2065 s2[0] = 3; 2066 s2[1] = 4; 2067 s2[2] = 5; 2068 2069 TVirtualPad *pad = gPad; 2070 pad->Divide(2,1); 2071 2072 TH1D *inout[2]; 2073 2074 for (int i=0; i<2; i++) 2075 { 2076 pad->cd(i+1); 2077 gPad->SetBorderMode(0); 2078 gPad->SetTicks(); 2079 2080 inout[i] = cam->ProjectionS(TArrayI(), TArrayI(1,&i), i==0 ? "Inner" : "Outer"); 2081 FixDataCheckHist(inout[i]); 2082 inout[i]->SetTitle(Form("%s %s",cam->GetTitle(),i==0 ? "Inner" : "Outer")); 2083 inout[i]->SetDirectory(NULL); 2084 inout[i]->SetLineColor(kRed+i); 2085 inout[i]->SetBit(kCanDelete); 2086 inout[i]->Draw(); 2087 // 2088 // Display the outliers as dead and noisy pixels 2089 // 2090 if (!inout[i]->Fit("gaus","0Q")) 2091 DisplayOutliers(inout[i],whatsmall,whatbig); 2092 2093 gPad->Modified(); 2094 gPad->Update(); 2095 TPaveStats *st = (TPaveStats*)inout[i]->GetListOfFunctions()->FindObject("stats"); 2096 st->SetY1NDC(0.6); 2097 st->SetY2NDC(0.9); 2098 st->SetX1NDC(0.55); 2099 st->SetX2NDC(0.99); 2100 gPad->Modified(); 2101 gPad->Update(); 2102 2103 TLegend *leg2 = new TLegend(0.55,0.4,0.99,0.6); 2104 2105 // 2106 // Display the two half of the camera separately 2107 // 2108 TH1D *half[2]; 2109 half[0] = cam->ProjectionS(s1, TArrayI(1,&i), "Sector 6-1-2"); 2110 half[1] = cam->ProjectionS(s2, TArrayI(1,&i), "Sector 3-4-5"); 2111 2112 for (int j=0; j<2; j++) 1881 TVirtualPad *pad = gPad; 1882 pad->Divide(2, 1, 1e-5, 1e-5);; 1883 1884 for (int i=0; i<2; i++) 1885 { 1886 pad->cd(i+1); 1887 gPad->SetBorderMode(0); 1888 gPad->SetTicks(); 1889 1890 TH1D &h = *cam.ProjectionS(TArrayI(), TArrayI(1, &i), Form("%s_%s", cam.GetName(), i==0?"Inner":"Outer")); 1891 FixDataCheckHist(h); 1892 h.SetTitle(Form("%s %s",cam.GetTitle(), i==0?"Inner":"Outer")); 1893 h.SetDirectory(NULL); 1894 h.SetBit(kCanDelete); 1895 h.Draw(); 1896 1897 h.Fit("gaus", "Q"); 1898 1899 TF1 *f = h.GetFunction("gaus"); 1900 if (f) 2113 1901 { 2114 half[j]->SetLineColor(kRed+i+2*j+1); 2115 half[j]->SetDirectory(NULL); 2116 half[j]->SetBit(kCanDelete); 2117 half[j]->Draw("same"); 2118 leg2->AddEntry(half[j], half[j]->GetName(), "l"); 1902 f->SetLineWidth(2); 1903 f->SetLineColor(kBlue); 2119 1904 } 2120 leg2->Draw();2121 1905 } 2122 1906 } -
trunk/MagicSoft/Mars/mjobs/MJCalibration.h
r8788 r8990 118 118 Bool_t IsDebug () const { return TESTBIT(fFlags,kDebug); } 119 119 120 void DrawBadPixel(TPaveText &pave, const MHCamera &h, Int_t n, Float_t f, const char *str) const;120 MHCamera *DrawBadPixelPad(const MHCamera &h, Bool_t unsuit) const; 121 121 void DrawTab(MParList &plist, const char *cont, const char *name, Option_t *opt); 122 122 123 void DisplayResult ( MParList &plist ); 124 void DisplayReferenceLines( MHCamera *cam , const Int_t what ) const; 125 void DisplayOutliers ( TH1D *hist, const char* whatsmall, const char* whatbig ) const; 126 void DisplayDoubleProject ( MHCamera *cam , const char* whatsmall, const char* whatbig ) const; 127 void FixDataCheckHist ( TH1D *hist ) const; 123 void DisplayResult(MParList &plist); 124 void DisplayReferenceLines(const MHCamera *cam, const Int_t what) const; 125 //void DisplayOutliers ( TH1D *hist, const char* whatsmall, const char* whatbig ) const; 128 126 129 127 Bool_t WriteResult (MParList &plist); … … 177 175 Bool_t Process(MPedestalCam &pedcam); 178 176 177 // Public helper functions 178 static void DisplayDoubleProject(const MHCamera &cam); 179 static void FixDataCheckHist(TH1D &hist, Double_t min=-1111, Double_t max=-1111); 180 179 181 ClassDef(MJCalibration, 0) // Tool to run a calibration per pulser colour and intensity 180 182 }; -
trunk/MagicSoft/Mars/mjobs/MJPedestal.cc
r8986 r8990 19 19 ! Author(s): Markus Gaug, 4/2004 <mailto:markus@ifae.es> 20 20 ! 21 ! Copyright: MAGIC Software Development, 2000-200 721 ! Copyright: MAGIC Software Development, 2000-2008 22 22 ! 23 23 ! … … 89 89 #include "MPedestalSubtract.h" 90 90 91 // Display helpers 92 #include "MJCalibration.h" 93 91 94 ClassImp(MJPedestal); 92 95 … … 393 396 gPad->SetBorderMode(0); 394 397 gPad->SetTicks(); 395 TH1D *obj2 = (TH1D*)obj1->Projection( obj1->GetName());398 TH1D *obj2 = (TH1D*)obj1->Projection(); 396 399 obj2->Draw(); 397 400 obj2->SetBit(kCanDelete); … … 431 434 432 435 if (geomcam.InheritsFrom("MGeomCamMagic")) 433 { 434 TArrayI inner(1); 435 inner[0] = 0; 436 437 TArrayI outer(1); 438 outer[0] = 1; 439 440 TArrayI s0(6); 441 s0[0] = 6; 442 s0[1] = 1; 443 s0[2] = 2; 444 s0[3] = 3; 445 s0[4] = 4; 446 s0[5] = 5; 447 448 TArrayI s1(3); 449 s1[0] = 6; 450 s1[1] = 1; 451 s1[2] = 2; 452 453 TArrayI s2(3); 454 s2[0] = 3; 455 s2[1] = 4; 456 s2[2] = 5; 457 458 TVirtualPad *pad = gPad; 459 pad->Divide(2,1); 460 461 TH1D *inout[2]; 462 inout[0] = disp1.ProjectionS(s0, inner, "Inner"); 463 inout[1] = disp1.ProjectionS(s0, outer, "Outer"); 464 FixDataCheckHist(inout[0]); 465 FixDataCheckHist(inout[1]); 466 467 inout[0]->SetTitle(Form("%s %s",disp1.GetTitle(),"Inner")); 468 inout[1]->SetTitle(Form("%s %s",disp1.GetTitle(),"Outer")); 469 470 471 for (int i=0; i<2; i++) 472 { 473 pad->cd(i+1); 474 gPad->SetBorderMode(0); 475 gPad->SetTicks(); 476 477 inout[i]->SetDirectory(NULL); 478 inout[i]->SetLineColor(kRed+i); 479 inout[i]->SetBit(kCanDelete); 480 inout[i]->Draw(); 481 inout[i]->Fit("gaus", "Q"); 482 483 TLegend *leg2 = new TLegend(0.6,0.2,0.9,0.55); 484 leg2->SetHeader(inout[i]->GetName()); 485 leg2->AddEntry(inout[i], inout[i]->GetName(), "l"); 486 487 // 488 // Display the outliers as dead and noisy pixels 489 // 490 DisplayOutliers(inout[i]); 491 492 // 493 // Display the two half of the camera separately 494 // 495 TH1D *half[2]; 496 half[0] = disp1.ProjectionS(s1, i==0 ? inner : outer , "Sector 6-1-2"); 497 half[1] = disp1.ProjectionS(s2, i==0 ? inner : outer , "Sector 3-4-5"); 498 499 for (int j=0; j<2; j++) 500 { 501 half[j]->SetLineColor(kRed+i+2*j+1); 502 half[j]->SetDirectory(NULL); 503 half[j]->SetBit(kCanDelete); 504 half[j]->Draw("same"); 505 leg2->AddEntry(half[j], half[j]->GetName(), "l"); 506 } 507 leg2->Draw(); 508 delete leg2; 509 } 436 { 437 MJCalibration::DisplayDoubleProject(disp1); 510 438 return; 511 439 } 512 440 } 513 441 … … 578 506 line.DrawLine(398, fRefPedRmsGalacticOuter, 579 507 x2, fRefPedRmsGalacticOuter); 580 508 581 509 line.SetLineColor(kYellow); 582 510 line.DrawLine(398, fRefPedRmsExtraGalacticOuter, 583 511 x2, fRefPedRmsExtraGalacticOuter); 584 512 585 513 line.SetLineColor(kMagenta); 586 514 line.DrawLine(398, fRefPedRmsClosedLidsOuter, … … 595 523 } 596 524 525 /* 597 526 void MJPedestal::DisplayOutliers(TH1D *hist) const 598 527 { … … 611 540 noisytex.DrawLatex(0.1,hist->GetBinContent(hist->GetMaximumBin())/1.2,Form("%3i noisy pixels",(Int_t)noisy)); 612 541 } 542 */ 613 543 614 544 void MJPedestal::FixDataCheckHist(TH1D *hist) const -
trunk/MagicSoft/Mars/mjobs/MJPedestal.h
r8795 r8990 84 84 void DisplayResult(const MParList &plist); 85 85 void DisplayReferenceLines(MHCamera *cam, const Int_t what) const; 86 void DisplayOutliers(TH1D *hist) const;86 //void DisplayOutliers(TH1D *hist) const; 87 87 void FixDataCheckHist(TH1D *hist) const; 88 88 Int_t PulsePosCheck(const MParList &plist) const;
Note:
See TracChangeset
for help on using the changeset viewer.