Changeset 5533 for trunk/MagicSoft/Mars/mjobs/MJPedestal.cc
- Timestamp:
- 11/30/04 21:22:56 (20 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/mjobs/MJPedestal.cc
r5520 r5533 339 339 // 340 340 if (fDisplayType != kDataCheckDisplay && fExtractType != kUseHists && !fExtractorResolution) 341 {342 TCanvas &c3 = fDisplay->AddTab("Pedestals");343 c3.Divide(2,3);344 345 disp0.CamDraw(c3, 1, 2, 1);346 disp1.CamDraw(c3, 2, 2, 6);347 return;348 }349 350 if (fExtractorResolution)351 341 { 352 353 TCanvas &c3 = fDisplay->AddTab("Extr.Res."); 342 TCanvas &c3 = fDisplay->AddTab("Pedestals"); 354 343 c3.Divide(2,3); 355 344 356 345 disp0.CamDraw(c3, 1, 2, 1); 357 346 disp1.CamDraw(c3, 2, 2, 6); 358 359 TCanvas &c13 = fDisplay->AddTab("Diff.(Extr.-Pedestal)");360 c13.Divide(2,3);361 362 disp9.CamDraw(c13, 1, 2, 5);363 disp10.CamDraw(c13, 2, 2, 5);364 347 return; 365 348 } 366 349 367 350 if (fExtractType == kUseHists) 368 351 { 369 352 370 353 TCanvas &c3 = fDisplay->AddTab("Extractor Hist."); 371 354 c3.Divide(2,3); … … 395 378 } 396 379 397 TCanvas &c3 = fDisplay->AddTab(fExtractorResolution ? "Extr.Res." : "Pedestals"); 398 c3.Divide(2,3); 399 400 c3.cd(1); 401 gPad->SetBorderMode(0); 402 gPad->SetTicks(); 403 MHCamera *obj1=(MHCamera*)disp0.DrawCopy("hist"); 404 // 405 // for the datacheck, fix the ranges!! 406 // 407 obj1->SetMinimum(fgPedestalMin); 408 obj1->SetMaximum(fgPedestalMax); 409 410 // 411 // Set the datacheck sizes: 412 // 413 FixDataCheckHist((TH1D*)obj1); 414 // 415 // set reference lines 416 // 417 DisplayReferenceLines(obj1,0); 418 419 // 420 // end reference lines 421 // 422 c3.cd(3); 423 gPad->SetBorderMode(0); 424 obj1->SetPrettyPalette(); 425 obj1->Draw(); 426 427 c3.cd(5); 428 gPad->SetBorderMode(0); 429 gPad->SetTicks(); 430 TH1D *obj2 = (TH1D*)obj1->Projection(obj1->GetName()); 431 obj2->Draw(); 432 obj2->SetBit(kCanDelete); 433 obj2->Fit("gaus","Q"); 434 obj2->GetFunction("gaus")->SetLineColor(kYellow); 435 // 436 // Set the datacheck sizes: 437 // 438 FixDataCheckHist(obj2); 439 obj2->SetStats(1); 440 441 c3.cd(2); 442 gPad->SetBorderMode(0); 443 gPad->SetTicks(); 444 MHCamera *obj3=(MHCamera*)disp1.DrawCopy("hist"); 445 // 446 // for the datacheck, fix the ranges!! 447 // 448 obj3->SetMinimum(fgPedRmsMin); 449 obj3->SetMaximum(fgPedRmsMax); 450 // 451 // Set the datacheck sizes: 452 // 453 FixDataCheckHist((TH1D*)obj3); 454 // 455 // set reference lines 456 // 457 DisplayReferenceLines(obj1,1); 458 459 c3.cd(4); 460 gPad->SetBorderMode(0); 461 obj3->SetPrettyPalette(); 462 obj3->Draw(); 463 464 c3.cd(6); 465 gPad->SetBorderMode(0); 466 467 if (geomcam.InheritsFrom("MGeomCamMagic")) 468 { 469 TArrayI inner(1); 470 inner[0] = 0; 471 472 TArrayI outer(1); 473 outer[0] = 1; 474 475 TArrayI s0(6); 476 s0[0] = 6; 477 s0[1] = 1; 478 s0[2] = 2; 479 s0[3] = 3; 480 s0[4] = 4; 481 s0[5] = 5; 482 483 TArrayI s1(3); 484 s1[0] = 6; 485 s1[1] = 1; 486 s1[2] = 2; 487 488 TArrayI s2(3); 489 s2[0] = 3; 490 s2[1] = 4; 491 s2[2] = 5; 492 493 TVirtualPad *pad = gPad; 494 pad->Divide(2,1); 495 496 TH1D *inout[2]; 497 inout[0] = disp1.ProjectionS(s0, inner, "Inner"); 498 inout[1] = disp1.ProjectionS(s0, outer, "Outer"); 499 FixDataCheckHist(inout[0]); 500 FixDataCheckHist(inout[1]); 501 502 inout[0]->SetTitle(Form("%s %s",disp1.GetTitle(),"Inner")); 503 inout[1]->SetTitle(Form("%s %s",disp1.GetTitle(),"Outer")); 504 505 506 for (int i=0; i<2; i++) 507 { 508 pad->cd(i+1); 509 gPad->SetBorderMode(0); 510 gPad->SetTicks(); 511 512 inout[i]->SetDirectory(NULL); 513 inout[i]->SetLineColor(kRed+i); 514 inout[i]->SetBit(kCanDelete); 515 inout[i]->Draw(); 516 inout[i]->Fit("gaus", "Q"); 517 518 TLegend *leg2 = new TLegend(0.6,0.2,0.9,0.55); 519 leg2->SetHeader(inout[i]->GetName()); 520 leg2->AddEntry(inout[i], inout[i]->GetName(), "l"); 521 380 if (fDisplayType == kDataCheckDisplay) 381 { 382 383 TCanvas &c3 = fDisplay->AddTab(fExtractorResolution ? "Extr.Res." : "Pedestals"); 384 c3.Divide(2,3); 385 386 c3.cd(1); 387 gPad->SetBorderMode(0); 388 gPad->SetTicks(); 389 MHCamera *obj1=(MHCamera*)disp0.DrawCopy("hist"); 390 // 391 // for the datacheck, fix the ranges!! 392 // 393 if (!fExtractorResolution) 394 { 395 obj1->SetMinimum(fgPedestalMin); 396 obj1->SetMaximum(fgPedestalMax); 522 397 // 523 // Display the outliers as dead and noisy pixels398 // Set the datacheck sizes: 524 399 // 525 DisplayOutliers(inout[i]); 526 400 FixDataCheckHist((TH1D*)obj1); 527 401 // 528 // Display the two half of the camera separately402 // set reference lines 529 403 // 530 TH1D *half[2]; 531 half[0] = disp1.ProjectionS(s1, i==0 ? inner : outer , "Sector 6-1-2"); 532 half[1] = disp1.ProjectionS(s2, i==0 ? inner : outer , "Sector 3-4-5"); 533 534 for (int j=0; j<2; j++) 535 { 536 half[j]->SetLineColor(kRed+i+2*j+1); 537 half[j]->SetDirectory(NULL); 538 half[j]->SetBit(kCanDelete); 539 half[j]->Draw("same"); 540 leg2->AddEntry(half[j], half[j]->GetName(), "l"); 541 } 542 leg2->Draw(); 543 delete leg2; 544 } 545 546 } 547 404 DisplayReferenceLines(obj1,0); 405 } 406 407 // 408 // end reference lines 409 // 410 c3.cd(3); 411 gPad->SetBorderMode(0); 412 obj1->SetPrettyPalette(); 413 obj1->Draw(); 414 415 c3.cd(5); 416 gPad->SetBorderMode(0); 417 gPad->SetTicks(); 418 TH1D *obj2 = (TH1D*)obj1->Projection(obj1->GetName()); 419 obj2->Draw(); 420 obj2->SetBit(kCanDelete); 421 obj2->Fit("gaus","Q"); 422 obj2->GetFunction("gaus")->SetLineColor(kYellow); 423 // 424 // Set the datacheck sizes: 425 // 426 FixDataCheckHist(obj2); 427 obj2->SetStats(1); 428 429 c3.cd(2); 430 gPad->SetBorderMode(0); 431 gPad->SetTicks(); 432 MHCamera *obj3=(MHCamera*)disp1.DrawCopy("hist"); 433 // 434 // for the datacheck, fix the ranges!! 435 // 436 obj3->SetMinimum(fgPedRmsMin); 437 obj3->SetMaximum(fgPedRmsMax); 438 // 439 // Set the datacheck sizes: 440 // 441 FixDataCheckHist((TH1D*)obj3); 442 // 443 // set reference lines 444 // 445 DisplayReferenceLines(obj3,1); 446 447 c3.cd(4); 448 gPad->SetBorderMode(0); 449 obj3->SetPrettyPalette(); 450 obj3->Draw(); 451 452 c3.cd(6); 453 gPad->SetBorderMode(0); 454 455 if (geomcam.InheritsFrom("MGeomCamMagic")) 456 { 457 TArrayI inner(1); 458 inner[0] = 0; 459 460 TArrayI outer(1); 461 outer[0] = 1; 462 463 TArrayI s0(6); 464 s0[0] = 6; 465 s0[1] = 1; 466 s0[2] = 2; 467 s0[3] = 3; 468 s0[4] = 4; 469 s0[5] = 5; 470 471 TArrayI s1(3); 472 s1[0] = 6; 473 s1[1] = 1; 474 s1[2] = 2; 475 476 TArrayI s2(3); 477 s2[0] = 3; 478 s2[1] = 4; 479 s2[2] = 5; 480 481 TVirtualPad *pad = gPad; 482 pad->Divide(2,1); 483 484 TH1D *inout[2]; 485 inout[0] = disp1.ProjectionS(s0, inner, "Inner"); 486 inout[1] = disp1.ProjectionS(s0, outer, "Outer"); 487 FixDataCheckHist(inout[0]); 488 FixDataCheckHist(inout[1]); 489 490 inout[0]->SetTitle(Form("%s %s",disp1.GetTitle(),"Inner")); 491 inout[1]->SetTitle(Form("%s %s",disp1.GetTitle(),"Outer")); 492 493 494 for (int i=0; i<2; i++) 495 { 496 pad->cd(i+1); 497 gPad->SetBorderMode(0); 498 gPad->SetTicks(); 499 500 inout[i]->SetDirectory(NULL); 501 inout[i]->SetLineColor(kRed+i); 502 inout[i]->SetBit(kCanDelete); 503 inout[i]->Draw(); 504 inout[i]->Fit("gaus", "Q"); 505 506 TLegend *leg2 = new TLegend(0.6,0.2,0.9,0.55); 507 leg2->SetHeader(inout[i]->GetName()); 508 leg2->AddEntry(inout[i], inout[i]->GetName(), "l"); 509 510 // 511 // Display the outliers as dead and noisy pixels 512 // 513 DisplayOutliers(inout[i]); 514 515 // 516 // Display the two half of the camera separately 517 // 518 TH1D *half[2]; 519 half[0] = disp1.ProjectionS(s1, i==0 ? inner : outer , "Sector 6-1-2"); 520 half[1] = disp1.ProjectionS(s2, i==0 ? inner : outer , "Sector 3-4-5"); 521 522 for (int j=0; j<2; j++) 523 { 524 half[j]->SetLineColor(kRed+i+2*j+1); 525 half[j]->SetDirectory(NULL); 526 half[j]->SetBit(kCanDelete); 527 half[j]->Draw("same"); 528 leg2->AddEntry(half[j], half[j]->GetName(), "l"); 529 } 530 leg2->Draw(); 531 delete leg2; 532 } 533 return; 534 } 535 536 if (fExtractorResolution) 537 { 538 539 TCanvas &c3 = fDisplay->AddTab("Extr.Res."); 540 c3.Divide(2,3); 541 542 disp0.CamDraw(c3, 1, 2, 1); 543 disp1.CamDraw(c3, 2, 2, 6); 544 545 TCanvas &c13 = fDisplay->AddTab("Diff.(Extr.-Pedestal)"); 546 c13.Divide(2,3); 547 548 disp9.CamDraw(c13, 1, 2, 5); 549 disp10.CamDraw(c13, 2, 2, 5); 550 return; 551 } 552 } 548 553 } 549 554 … … 551 556 void MJPedestal::DisplayReferenceLines(MHCamera *cam, const Int_t what) const 552 557 { 558 553 559 Double_t x = cam->GetNbinsX(); 554 560 … … 599 605 leg->AddEntry(l3, "Closed Lids","l"); 600 606 leg->Draw(); 601 delete leg;602 607 } 603 608
Note:
See TracChangeset
for help on using the changeset viewer.