Changeset 4620 for trunk/MagicSoft/Mars/mjobs/MJCalibration.cc
- Timestamp:
- 08/16/04 12:10:57 (20 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/mjobs/MJCalibration.cc
r4613 r4620 92 92 #include <TCanvas.h> 93 93 #include <TSystem.h> 94 #include <TLine.h> 95 #include <TLatex.h> 96 #include <TLegend.h> 94 97 95 98 #include "MLog.h" … … 108 111 #include "MCalibrationCam.h" 109 112 #include "MCalibrationQECam.h" 113 #include "MCalibrationQEPix.h" 110 114 #include "MCalibrationChargeCam.h" 115 #include "MCalibrationChargePix.h" 111 116 #include "MCalibrationChargePINDiode.h" 112 117 #include "MCalibrationChargeBlindPix.h" … … 246 251 MHCamera disp3 (geomcam, "RSigma", "Reduced Sigmas"); 247 252 MHCamera disp4 (geomcam, "RSigmaPerCharge", "Reduced Sigma per Charge"); 248 MHCamera disp5 (geomcam, "NumPhes", "N r. of Phe's (F-Factor Method)");249 MHCamera disp6 (geomcam, "ConvFADC2Phes", "Conversion Factor (F-Factor Method)");253 MHCamera disp5 (geomcam, "NumPhes", "Number of Phes"); 254 MHCamera disp6 (geomcam, "ConvFADC2Phes", "Conversion Factor to Phes"); 250 255 MHCamera disp7 (geomcam, "TotalFFactor", "Total F-Factor (F-Factor Method)"); 251 256 MHCamera disp8 (geomcam, "CascadesQEFFactor", "Cascades QE (F-Factor Method)"); … … 276 281 MHCamera disp33(geomcam, "TimeNotFitValid", "Pixels with not valid fit results"); 277 282 MHCamera disp34(geomcam, "TimeOscillating", "Oscillating Pixels"); 283 MHCamera disp35(geomcam, "TotalConv", "Conversion Factor to photons"); 278 284 279 285 // Fitted charge means and sigmas … … 346 352 disp4.SetYTitle("Red.Sigma/<Q> [1]"); 347 353 348 disp5.SetYTitle(" Nr. Phe's [1]");354 disp5.SetYTitle("Phes [1]"); 349 355 disp6.SetYTitle("Conv.Factor [PhE/FADC counts]"); 350 356 disp7.SetYTitle("Total F-Factor [1]"); … … 376 382 disp28.SetYTitle("Mean Abs. Time [FADC slice]"); 377 383 disp29.SetYTitle("RMS Abs. Time [FADC slices]"); 384 385 disp35.SetYTitle("Conv.Factor [Ph/FADC counts]"); 386 387 for (UInt_t i=0;i<geomcam.GetNumPixels();i++) 388 { 389 390 MCalibrationChargePix &pix = (MCalibrationChargePix&)fCalibrationCam[i]; 391 MCalibrationQEPix &qe = (MCalibrationQEPix&) fQECam [i]; 392 393 if (!pix.IsFFactorMethodValid()) 394 continue; 395 396 const Float_t convphe = pix.GetMeanConvFADC2Phe(); 397 const Float_t quaeff = qe.GetQECascadesFFactor(0.); 398 399 disp35.Fill(i,convphe/quaeff); 400 disp35.SetUsed(i); 401 } 402 378 403 379 404 if (fRelTimes) … … 393 418 disp34.SetYTitle("[1]"); 394 419 } 420 421 395 422 396 423 if (fDisplayType == kDataCheckDisplay) 397 424 { 398 399 TCanvas &c1 = fDisplay->AddTab("Fit.Charge"); 400 c1.Divide(3, 3); 401 402 disp1.CamDraw( c1, 1, 3, 5); 403 disp4.CamDraw( c1, 2, 3, 5); 404 disp28.CamDraw(c1, 3, 3, 5); 405 406 // F-Factor 407 TCanvas &c2 = fDisplay->AddTab("Phe's"); 408 c2.Divide(3,4); 409 410 disp6.CamDraw(c2, 1, 3, 5, 1); 411 disp7.CamDraw(c2, 2, 3, 5, 1); 412 disp8.CamDraw(c2, 3, 3, 5, 1); 413 414 // QE's 415 TCanvas &c3 = fDisplay->AddTab("QE's"); 416 c3.Divide(3,4); 417 418 disp8.CamDraw(c3, 1, 3, 5, 1); 419 disp9.CamDraw(c3, 2, 3, 5, 1); 420 disp10.CamDraw(c3, 3, 3, 5, 1); 421 422 // Defects 423 TCanvas &c4 = fDisplay->AddTab("Defect"); 424 c4.Divide(2,2); 425 426 disp24.CamDraw(c4, 1, 2, 0); 427 disp25.CamDraw(c4, 2, 2, 0); 428 429 if (fRelTimes) 425 426 TCanvas &c1 = fDisplay->AddTab("Fit.Charge"); 427 c1.Divide(3, 3); 428 429 // 430 // MEAN CHARGES 431 // 432 433 c1.cd(1); 434 gPad->SetBorderMode(0); 435 gPad->SetTicks(); 436 MHCamera *obj1=(MHCamera*)disp1.DrawCopy("hist"); 437 // 438 // for the datacheck, fix the ranges!! 439 // 440 // obj1->SetMinimum(fgChargeMin); 441 // obj1->SetMaximum(fgChargeMax); 442 // 443 // Set the datacheck sizes: 444 // 445 FixDataCheckHist((TH1D*)obj1); 446 // 447 // set reference lines 448 // 449 // DisplayReferenceLines(obj1,0); 450 451 c1.cd(4); 452 gPad->SetBorderMode(0); 453 obj1->SetPrettyPalette(); 454 obj1->Draw(); 455 456 c1.cd(7); 457 gPad->SetBorderMode(0); 458 gPad->SetTicks(); 459 TH1D *obj2 = (TH1D*)obj1->Projection(obj1->GetName()); 460 obj2->Draw(); 461 obj2->SetBit(kCanDelete); 462 obj2->Fit("gaus","Q"); 463 TF1 *fun2 = obj2->GetFunction("gaus"); 464 fun2->SetLineColor(kYellow); 465 // 466 // Set the datacheck sizes: 467 // 468 FixDataCheckHist(obj2); 469 obj2->SetStats(1); 470 471 // 472 // Display the outliers as dead and noisy pixels 473 // 474 DisplayOutliers(obj2,"dead","noisy"); 475 TLatex flattex; 476 flattex.SetTextSize(0.06); 477 const Double_t minl = obj2->GetBinCenter(obj2->GetXaxis()->GetFirst()); 478 const Double_t maxl = obj2->GetBinCenter(obj2->GetXaxis()->GetLast()); 479 flattex.DrawLatex(minl+0.1*(maxl-minl),obj2->GetBinContent(obj2->GetMaximumBin())/1.3, 480 Form("Flatfielding precision: %4.2f%%", 481 fun2->GetParameter(2)/fun2->GetParameter(1)*100.)); 482 483 // 484 // REDUCED SIGMAS 485 // 486 487 c1.cd(2); 488 gPad->SetBorderMode(0); 489 gPad->SetTicks(); 490 MHCamera *obj3=(MHCamera*)disp4.DrawCopy("hist"); 491 // 492 // for the datacheck, fix the ranges!! 493 // 494 // obj3->SetMinimum(fgChargeMin); 495 // obj3->SetMaximum(fgChargeMax); 496 // 497 // Set the datacheck sizes: 498 // 499 FixDataCheckHist((TH1D*)obj3); 500 // 501 // set reference lines 502 // 503 // DisplayReferenceLines(obj3,0); 504 505 c1.cd(5); 506 gPad->SetBorderMode(0); 507 obj3->SetPrettyPalette(); 508 obj3->Draw(); 509 510 c1.cd(8); 511 gPad->SetBorderMode(0); 512 if (geomcam.InheritsFrom("MGeomCamMagic")) 513 DisplayDoubleProject(&disp4, "dead", "noisy"); 514 515 // 516 // PHOTO ELECTRONS 517 // 518 519 c1.cd(3); 520 gPad->SetBorderMode(0); 521 gPad->SetTicks(); 522 MHCamera *obj4=(MHCamera*)disp5.DrawCopy("hist"); 523 // 524 // for the datacheck, fix the ranges!! 525 // 526 // obj3->SetMinimum(fgChargeMin); 527 // obj3->SetMaximum(fgChargeMax); 528 // 529 // Set the datacheck sizes: 530 // 531 FixDataCheckHist((TH1D*)obj4); 532 // 533 // set reference lines 534 // 535 // DisplayReferenceLines(obj3,0); 536 537 c1.cd(6); 538 gPad->SetBorderMode(0); 539 obj4->SetPrettyPalette(); 540 obj4->Draw(); 541 542 c1.cd(9); 543 gPad->SetBorderMode(0); 544 if (geomcam.InheritsFrom("MGeomCamMagic")) 545 DisplayDoubleProject(&disp5, "dead", "noisy"); 546 547 // 548 // CONVERSION FACTORS 549 // 550 551 TCanvas &c2 = fDisplay->AddTab("Conversion"); 552 c2.Divide(3,3); 553 554 c2.cd(1); 555 gPad->SetBorderMode(0); 556 gPad->SetTicks(); 557 MHCamera *obj5=(MHCamera*)disp6.DrawCopy("hist"); 558 // 559 // for the datacheck, fix the ranges!! 560 // 561 // obj5->SetMinimum(fgChargeMin); 562 // obj5->SetMaximum(fgChargeMax); 563 // 564 // Set the datacheck sizes: 565 // 566 FixDataCheckHist((TH1D*)obj5); 567 // 568 // set reference lines 569 // 570 // DisplayReferenceLines(obj5,0); 571 572 c2.cd(4); 573 gPad->SetBorderMode(0); 574 obj5->SetPrettyPalette(); 575 obj5->Draw(); 576 577 c2.cd(7); 578 gPad->SetBorderMode(0); 579 if (geomcam.InheritsFrom("MGeomCamMagic")) 580 DisplayDoubleProject(&disp6, "noisy", "dead"); 581 582 // 583 // QUANTUM EFFICIENCY 584 // 585 586 c2.cd(2); 587 gPad->SetBorderMode(0); 588 gPad->SetTicks(); 589 MHCamera *obj6=(MHCamera*)disp8.DrawCopy("hist"); 590 // 591 // for the datacheck, fix the ranges!! 592 // 593 // obj6->SetMinimum(fgChargeMin); 594 // obj6->SetMaximum(fgChargeMax); 595 // 596 // Set the datacheck sizes: 597 // 598 FixDataCheckHist((TH1D*)obj6); 599 // 600 // set reference lines 601 // 602 // DisplayReferenceLines(obj6,0); 603 604 c2.cd(5); 605 gPad->SetBorderMode(0); 606 obj6->SetPrettyPalette(); 607 obj6->Draw(); 608 609 c2.cd(8); 610 gPad->SetBorderMode(0); 611 if (geomcam.InheritsFrom("MGeomCamMagic")) 612 DisplayDoubleProject(&disp8, "noisy", "dead"); 613 614 // 615 // CONVERSION FADC TO PHOTONS 616 // 617 618 c2.cd(3); 619 gPad->SetBorderMode(0); 620 gPad->SetTicks(); 621 MHCamera *obj7=(MHCamera*)disp35.DrawCopy("hist"); 622 // 623 // for the datacheck, fix the ranges!! 624 // 625 // obj3->SetMinimum(fgChargeMin); 626 // obj3->SetMaximum(fgChargeMax); 627 // 628 // Set the datacheck sizes: 629 // 630 FixDataCheckHist((TH1D*)obj7); 631 // 632 // set reference lines 633 // 634 // DisplayReferenceLines(obj3,0); 635 636 c2.cd(6); 637 gPad->SetBorderMode(0); 638 obj7->SetPrettyPalette(); 639 obj7->Draw(); 640 c2.cd(9); 641 gPad->SetBorderMode(0); 642 if (geomcam.InheritsFrom("MGeomCamMagic")) 643 DisplayDoubleProject(&disp35, "noisy", "dead"); 644 645 // 646 // DEFECTS 647 // 648 TCanvas &c4 = fDisplay->AddTab("Defect"); 649 c4.Divide(2,2); 650 651 disp24.CamDraw(c4, 1, 2, 0); 652 disp25.CamDraw(c4, 2, 2, 0); 653 654 if (fRelTimes) 430 655 { 431 432 433 434 435 436 656 // Rel. Times 657 TCanvas &c5 = fDisplay->AddTab("Rel. Times"); 658 c5.Divide(2,4); 659 660 disp30.CamDraw(c5, 1, 2, 2); 661 disp31.CamDraw(c5, 2, 2, 2); 437 662 } 438 439 440 } 441 663 664 return; 665 } 666 442 667 if (fDisplayType == kNormalDisplay) 443 {444 668 { 669 445 670 // Charges 446 671 TCanvas &c11 = fDisplay->AddTab("Fit.Charge"); … … 625 850 } 626 851 } 627 628 852 853 854 void MJCalibration::DisplayReferenceLines(MHCamera *cam, const Int_t what) const 855 { 856 857 Double_t x = cam->GetNbinsX(); 858 859 const MGeomCam *geom = cam->GetGeometry(); 860 861 if (geom->InheritsFrom("MGeomCamMagic")) 862 x = what ? 397 : cam->GetNbinsX(); 863 864 TLine line; 865 line.SetLineStyle(kDashed); 866 line.SetLineWidth(3); 867 868 /* 869 line.SetLineColor(kBlue); 870 TLine *l1 = line.DrawLine(0, what ? fgRefPedRmsGalacticInner : fgRefPedGalactic, 871 x, what ? fgRefPedRmsGalacticInner : fgRefPedGalactic); 872 873 line.SetLineColor(kYellow); 874 TLine *l2 = line.DrawLine(0, what ? fgRefPedRmsExtraGalacticInner : fgRefPedExtraGalactic, 875 x, what ? fgRefPedRmsExtraGalacticInner : fgRefPedExtraGalactic); 876 877 line.SetLineColor(kMagenta); 878 TLine *l3 = line.DrawLine(0, what ? fgRefPedRmsClosedLidsInner : fgRefPedClosedLids, 879 x, what ? fgRefPedRmsClosedLidsInner : fgRefPedClosedLids); 880 881 if (geom->InheritsFrom("MGeomCamMagic")) 882 if (what) 883 { 884 const Double_t x2 = cam->GetNbinsX(); 885 886 line.SetLineColor(kBlue); 887 line.DrawLine(398, fgRefPedRmsGalacticOuter, 888 x2, fgRefPedRmsGalacticOuter); 889 890 line.SetLineColor(kYellow); 891 line.DrawLine(398, fgRefPedRmsExtraGalacticOuter, 892 x2, fgRefPedRmsExtraGalacticOuter); 893 894 line.SetLineColor(kMagenta); 895 line.DrawLine(398, fgRefPedRmsClosedLidsOuter, 896 x2, fgRefPedRmsClosedLidsOuter); 897 } 898 899 TLegend *leg = new TLegend(0.4,0.75,0.7,0.99); 900 leg->SetBit(kCanDelete); 901 leg->AddEntry(l1, "Galactic Source","l"); 902 leg->AddEntry(l2, "Extra-Galactic Source","l"); 903 leg->AddEntry(l3, "Closed Lids","l"); 904 leg->Draw(); 905 */ 906 907 908 } 909 910 void MJCalibration::DisplayOutliers(TH1D *hist, const char* whatsmall, const char* whatbig) const 911 { 912 913 const Float_t mean = hist->GetFunction("gaus")->GetParameter(1); 914 const Float_t lolim = mean - 4.0*hist->GetFunction("gaus")->GetParameter(2); 915 const Float_t uplim = mean + 4.0*hist->GetFunction("gaus")->GetParameter(2); 916 const Stat_t dead = hist->Integral(0,hist->FindBin(lolim)-1); 917 const Stat_t noisy = hist->Integral(hist->FindBin(uplim)+1,hist->GetNbinsX()+1); 918 919 const Double_t max = hist->GetBinContent(hist->GetMaximumBin()); 920 921 const Double_t minl = hist->GetBinCenter(hist->GetXaxis()->GetFirst()); 922 const Double_t maxl = hist->GetBinCenter(hist->GetXaxis()->GetLast()); 923 924 TLatex deadtex; 925 deadtex.SetTextSize(0.06); 926 deadtex.DrawLatex(minl+0.1*(maxl-minl),max/1.1, 927 Form("%3i %s pixels",(Int_t)dead,whatsmall)); 928 929 TLatex noisytex; 930 noisytex.SetTextSize(0.06); 931 noisytex.DrawLatex(minl+0.1*(maxl-minl),max/1.2, 932 Form("%3i %s pixels",(Int_t)noisy,whatbig)); 933 934 } 935 936 void MJCalibration::FixDataCheckHist(TH1D *hist) const 937 { 938 939 hist->SetDirectory(NULL); 940 941 // 942 // set the labels bigger 943 // 944 TAxis *xaxe = hist->GetXaxis(); 945 TAxis *yaxe = hist->GetYaxis(); 946 947 xaxe->CenterTitle(); 948 yaxe->CenterTitle(); 949 xaxe->SetTitleSize(0.06); 950 yaxe->SetTitleSize(0.06); 951 xaxe->SetTitleOffset(0.8); 952 yaxe->SetTitleOffset(0.85); 953 xaxe->SetLabelSize(0.05); 954 yaxe->SetLabelSize(0.05); 955 956 } 629 957 630 958 // -------------------------------------------------------------------------- … … 637 965 Bool_t MJCalibration::FindColor() 638 966 { 639 if (fSequence) 640 { 641 fColor = MCalibrationCam::kCT1; 642 return kTRUE; 643 } 644 645 const UInt_t nruns = fRuns->GetNumRuns(); 646 967 968 if (fSequence) 969 { 970 fColor = MCalibrationCam::kCT1; 971 return kTRUE; 972 } 973 974 const UInt_t nruns = fRuns->GetNumRuns(); 975 647 976 if (nruns == 0) 648 977 return kFALSE; … … 939 1268 MHCalibrationChargeBlindCam &blindcam) 940 1269 { 941 Int_t run = fSequence ? fSequence->GetLastRun() : fRuns->GetRuns()[fRuns->GetNumRuns()-1]; 942 943 // 944 // Initialize the blind pixel. Unfortunately, there is a hardware difference 945 // in the first blind pixel until run "gkSecondBlindPixelInstallation" and the 946 // later setup. The first needs to use a filter because of the length of 947 // spurious NSB photon signals. The latter get better along extracting the amplitude 948 // from a small window. 949 // 950 if (run < gkSecondBlindPixelInstallation) 951 { 952 blindext.SetModified(kFALSE); 953 blindext.SetExtractionType(MExtractBlindPixel::kIntegral); 954 blindext.SetExtractionType(MExtractBlindPixel::kFilter); 955 blindext.SetRange(10,19,0,6); 956 blindext.SetNSBFilterLimit(70); 957 blindcam.SetFitFunc( MHCalibrationChargeBlindPix::kEPoisson5 ); 958 } 959 else 960 { 961 blindext.SetModified(kTRUE); 962 blindext.SetExtractionType(MExtractBlindPixel::kAmplitude); 963 blindext.SetExtractionType(MExtractBlindPixel::kFilter); 964 blindext.SetRange(5,8,0,2); 965 blindext.SetNSBFilterLimit(38); 966 967 if (run < gkThirdBlindPixelInstallation) 968 blindext.SetNumBlindPixels(2); 969 else 970 blindext.SetNumBlindPixels(3); 1270 1271 Int_t run = fSequence ? fSequence->GetLastRun() : fRuns->GetRuns()[fRuns->GetNumRuns()-1]; 1272 1273 // 1274 // Initialize the blind pixel. Unfortunately, there is a hardware difference 1275 // in the first blind pixel until run "gkSecondBlindPixelInstallation" and the 1276 // later setup. The first needs to use a filter because of the length of 1277 // spurious NSB photon signals. The latter get better along extracting the amplitude 1278 // from a small window. 1279 // 1280 if (run < gkSecondBlindPixelInstallation) 1281 { 1282 blindext.SetModified(kFALSE); 1283 blindext.SetExtractionType(MExtractBlindPixel::kIntegral); 1284 blindext.SetExtractionType(MExtractBlindPixel::kFilter); 1285 blindext.SetRange(10,19,0,6); 1286 blindext.SetNSBFilterLimit(70); 1287 blindcam.SetFitFunc( MHCalibrationChargeBlindPix::kEPoisson5 ); 1288 } 1289 else 1290 { 1291 blindext.SetModified(kTRUE); 1292 blindext.SetExtractionType(MExtractBlindPixel::kAmplitude); 1293 blindext.SetExtractionType(MExtractBlindPixel::kFilter); 1294 blindext.SetRange(5,8,0,2); 1295 blindext.SetNSBFilterLimit(38); 1296 1297 if (run < gkThirdBlindPixelInstallation) 1298 blindext.SetNumBlindPixels(2); 1299 else 1300 blindext.SetNumBlindPixels(3); 971 1301 } 972 1302 } … … 1083 1413 MExtractTimeFastSpline timespline; 1084 1414 MCalibrationChargeCalc calcalc; 1415 MCalibrationRelTimeCalc timecalc; 1416 1085 1417 if (!fSequence) 1086 1418 { … … 1149 1481 1150 1482 tlist.AddToList(&fillcam); 1151 tlist.AddToList(&calcalc); 1152 1153 MCalibrationRelTimeCalc timecalc; 1483 1154 1484 if (fRelTimes) 1155 1485 { … … 1158 1488 } 1159 1489 1490 if (IsUseBlindPixel()) 1491 tlist.AddToList(&fillbnd); 1492 if (IsUsePINDiode()) 1493 tlist.AddToList(&fillpin); 1494 1495 tlist.AddToList(&calcalc); 1160 1496 1161 1497 // Create and setup the eventloop … … 1181 1517 // the display. No idea where this comes from... 1182 1518 // 1183 /*1184 1519 if (fDisplay) 1185 1520 { 1186 1521 if (IsUsePINDiode()) 1187 1522 { 1188 1189 1190 1523 MHCalibrationChargePINDiode *pin = 1524 (MHCalibrationChargePINDiode*)plist.FindObject("MHCalibrationChargePINDiode"); 1525 pin->DrawClone(Form("nonew %s",drawoption.Data())); 1191 1526 } 1192 1527 else if (IsUseBlindPixel()) 1193 1528 { 1194 MHCalibrationChargeBlindCam *cam = 1195 (MHCalibrationChargeBlindCam*)plist.FindObject("MHCalibrationChargeBlindCam"); 1529 MHCalibrationChargeBlindCam *cam = 1530 (MHCalibrationChargeBlindCam*)plist.FindObject("MHCalibrationChargeBlindCam"); 1531 cam->DrawClone(Form("nonew %s",drawoption.Data())); 1532 } 1533 else if (fRelTimes) 1534 { 1535 MHCalibrationRelTimeCam *cam = 1536 (MHCalibrationRelTimeCam*)plist.FindObject("MHCalibrationRelTimeCam"); 1196 1537 cam->DrawClone(Form("nonew %s",drawoption.Data())); 1197 1538 } 1198 else if (fRelTimes)1539 else 1199 1540 { 1200 MHCalibrationRelTimeCam *cam =1201 (MHCalibrationRelTimeCam*)plist.FindObject("MHCalibrationRelTimeCam");1202 1541 MHCalibrationChargeCam *cam = 1542 (MHCalibrationChargeCam*)plist.FindObject("MHCalibrationChargeCam"); 1543 cam->DrawClone(Form("nonew %s",drawoption.Data())); 1203 1544 } 1204 else 1205 { 1206 MHCalibrationChargeCam *cam = 1207 (MHCalibrationChargeCam*)plist.FindObject("MHCalibrationChargeCam"); 1208 cam->DrawClone(Form("nonew %s",drawoption.Data())); 1209 } 1210 } 1211 */ 1212 1545 } 1546 1213 1547 DisplayResult(plist); 1214 1548 … … 1377 1711 } 1378 1712 1713 void MJCalibration::DisplayDoubleProject(MHCamera *cam, const char* whatsmall, const char* whatbig) const 1714 { 1715 1716 TArrayI inner(1); 1717 inner[0] = 0; 1718 1719 TArrayI outer(1); 1720 outer[0] = 1; 1721 1722 TArrayI s0(6); 1723 s0[0] = 6; 1724 s0[1] = 1; 1725 s0[2] = 2; 1726 s0[3] = 3; 1727 s0[4] = 4; 1728 s0[5] = 5; 1729 1730 TArrayI s1(3); 1731 s1[0] = 6; 1732 s1[1] = 1; 1733 s1[2] = 2; 1734 1735 TArrayI s2(3); 1736 s2[0] = 3; 1737 s2[1] = 4; 1738 s2[2] = 5; 1739 1740 TVirtualPad *pad = gPad; 1741 pad->Divide(2,1); 1742 1743 TH1D *inout[2]; 1744 inout[0] = cam->ProjectionS(s0, inner, "Inner"); 1745 inout[1] = cam->ProjectionS(s0, outer, "Outer"); 1746 FixDataCheckHist(inout[0]); 1747 FixDataCheckHist(inout[1]); 1748 1749 inout[0]->SetTitle(Form("%s %s",cam->GetTitle(),"Inner")); 1750 inout[1]->SetTitle(Form("%s %s",cam->GetTitle(),"Outer")); 1751 1752 for (int i=0; i<2; i++) 1753 { 1754 pad->cd(i+1); 1755 gPad->SetBorderMode(0); 1756 gPad->SetTicks(); 1757 1758 inout[i]->SetDirectory(NULL); 1759 inout[i]->SetLineColor(kRed+i); 1760 inout[i]->SetBit(kCanDelete); 1761 inout[i]->Draw(); 1762 inout[i]->Fit("gaus", "Q"); 1763 1764 TLegend *leg2 = new TLegend(0.6,0.5,0.9,0.7); 1765 // 1766 // Display the outliers as dead and noisy pixels 1767 // 1768 DisplayOutliers(inout[i],whatsmall,whatbig); 1769 1770 // 1771 // Display the two half of the camera separately 1772 // 1773 TH1D *half[2]; 1774 half[0] = cam->ProjectionS(s1, i==0 ? inner : outer , "Sector 6-1-2"); 1775 half[1] = cam->ProjectionS(s2, i==0 ? inner : outer , "Sector 3-4-5"); 1776 1777 for (int j=0; j<2; j++) 1778 { 1779 half[j]->SetLineColor(kRed+i+2*j+1); 1780 half[j]->SetDirectory(NULL); 1781 half[j]->SetBit(kCanDelete); 1782 half[j]->Draw("same"); 1783 leg2->AddEntry(half[j], half[j]->GetName(), "l"); 1784 } 1785 leg2->Draw(); 1786 } 1787 }
Note:
See TracChangeset
for help on using the changeset viewer.