Changeset 1809 for trunk/MagicSoft/Mars/manalysis/MPadSchweizer.cc
- Timestamp:
- 03/08/03 14:00:30 (22 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/manalysis/MPadSchweizer.cc
r1772 r1809 1 2 1 /* ======================================================================== *\ 3 2 ! … … 102 101 fHDiffPixTheta = fHist3Diff; 103 102 103 fHSigmaTheta->SetDirectory(NULL); 104 fHSigmaPixTheta->SetDirectory(NULL); 105 fHDiffPixTheta->SetDirectory(NULL); 106 104 107 Print(); 105 108 } … … 239 242 fHDiffPixTh->SetZTitle("Sigma^2-Sigmabar^2"); 240 243 244 //-------------------------------------------------------------------- 245 246 memset(fErrors, 0, sizeof(fErrors)); 247 241 248 return kTRUE; 242 249 } … … 251 258 //*fLog << "Entry MPadSchweizer::Process();" << endl; 252 259 260 Int_t rc; 261 253 262 const UInt_t npix = fEvt->GetNumPixels(); 263 264 Double_t SigbarOld; 265 266 //*fLog << "before padding : " << endl; 267 //SigbarOld = fSigmabar->Calc(*fCam, *fPed, *fEvt); 268 //fSigmabar->Print(""); 269 254 270 255 271 //$$$$$$$$$$$$$$$$$$$$$$$$$$ 256 272 // to simulate the situation that before the padding the NSB and 257 273 // electronic noise are zero : set Sigma = 0 for all pixels 258 for (UInt_t i=0; i<npix; i++)259 {260 MCerPhotPix &pix = fEvt->operator[](i);261 Int_t j = pix.GetPixId();262 263 MPedestalPix &ppix = fPed->operator[](j);264 ppix.SetMeanRms(0.0);265 }274 //for (UInt_t i=0; i<npix; i++) 275 //{ 276 // MCerPhotPix &pix = fEvt->operator[](i); 277 // Int_t j = pix.GetPixId(); 278 279 // MPedestalPix &ppix = fPed->operator[](j); 280 // ppix.SetMeanRms(0.0); 281 //} 266 282 //$$$$$$$$$$$$$$$$$$$$$$$$$$ 267 283 … … 269 285 // Calculate average sigma of the event 270 286 // 271 Double_tSigbarOld = fSigmabar->Calc(*fCam, *fPed, *fEvt);287 SigbarOld = fSigmabar->Calc(*fCam, *fPed, *fEvt); 272 288 //fSigmabar->Print(""); 273 289 274 //if (SigbarOld > 0.0)275 //{290 if (SigbarOld > 0.0) 291 { 276 292 //*fLog << "MPadSchweizer::Process(); Sigmabar of event to be padded is > 0 : " 277 293 // << SigbarOld << ". Stop event loop " << endl; 278 294 // input data should have Sigmabar = 0; stop event loop 279 // return kFALSE; 280 //} 295 296 rc = 1; 297 fErrors[rc]++; 298 return kCONTINUE; 299 } 281 300 282 301 Double_t Theta = kRad2Deg*fMcEvt->GetTelescopeTheta(); … … 296 315 << Theta << ", " << binNumber << "; Skip event " << endl; 297 316 // event cannot be padded; skip event 317 318 rc = 2; 319 fErrors[rc]++; 298 320 return kCONTINUE; 299 321 } … … 308 330 // event cannot be padded; skip event 309 331 delete fHSigma; 332 333 rc = 3; 334 fErrors[rc]++; 310 335 return kCONTINUE; 311 336 } … … 331 356 *fLog << "MPadSchweizer::Process(); target Sigmabar is less than SigbarOld : " 332 357 << Sigmabar << ", " << SigbarOld << ", Skip event" << endl; 358 359 rc = 4; 360 fErrors[rc]++; 333 361 return kCONTINUE; 334 362 } … … 426 454 << binTheta << " and pixel bin " << binPixel 427 455 << " has no entries; aborting " << endl; 428 return kERROR; 456 457 rc = 5; 458 fErrors[rc]++; 459 return kCONTINUE; 429 460 } 430 461 … … 465 496 << binTheta << " and pixel bin " << binPixel 466 497 << " has no entries; aborting " << endl; 467 return kERROR; 498 499 rc = 6; 500 fErrors[rc]++; 501 return kCONTINUE; 468 502 } 469 503 … … 553 587 554 588 // Calculate Sigmabar again and crosscheck 589 555 590 Double_t SigbarNew = fSigmabar->Calc(*fCam, *fPed, *fEvt); 591 //*fLog << "after padding : " << endl; 556 592 //fSigmabar->Print(""); 557 593 … … 585 621 //*fLog << "Exit MPadSchweizer::Process();" << endl; 586 622 623 rc = 0; 624 fErrors[rc]++; 625 587 626 return kTRUE; 588 627 … … 594 633 Bool_t MPadSchweizer::PostProcess() 595 634 { 635 if (GetNumExecutions() != 0) 636 { 637 638 *fLog << inf << endl; 639 *fLog << GetDescriptor() << " execution statistics:" << endl; 640 *fLog << dec << setfill(' '); 641 *fLog << " " << setw(7) << fErrors[1] << " (" << setw(3) 642 << (int)(fErrors[1]*100/GetNumExecutions()) 643 << "%) Evts skipped due to: Sigmabar_old > 0" << endl; 644 645 *fLog << " " << setw(7) << fErrors[2] << " (" << setw(3) 646 << (int)(fErrors[2]*100/GetNumExecutions()) 647 << "%) Evts skipped due to: Zenith angle out of range" << endl; 648 649 *fLog << " " << setw(7) << fErrors[3] << " (" << setw(3) 650 << (int)(fErrors[3]*100/GetNumExecutions()) 651 << "%) Evts skipped due to: No data for generating Sigmabar" << endl; 652 653 *fLog << " " << setw(7) << fErrors[4] << " (" << setw(3) 654 << (int)(fErrors[4]*100/GetNumExecutions()) 655 << "%) Evts skipped due to: Target sigma <= Sigmabar_old" << endl; 656 657 *fLog << " " << setw(7) << fErrors[5] << " (" << setw(3) 658 << (int)(fErrors[5]*100/GetNumExecutions()) 659 << "%) Evts skipped due to: No data for generating Sigma^2-Sigmabar^2" << endl; 660 661 *fLog << " " << setw(7) << fErrors[6] << " (" << setw(3) 662 << (int)(fErrors[6]*100/GetNumExecutions()) 663 << "%) Evts skipped due to: No data for generating Sigma" << endl; 664 665 *fLog << " " << fErrors[0] << " (" 666 << (int)(fErrors[0]*100/GetNumExecutions()) 667 << "%) Evts survived the padding!" << endl; 668 *fLog << endl; 669 670 } 671 672 //--------------------------------------------------------------- 596 673 TCanvas &c = *(MH::MakeDefCanvas("PadSchweizer", "", 900, 1200)); 597 674 c.Divide(3, 4); … … 600 677 601 678 c.cd(1); 679 fHSigmaTheta->SetDirectory(NULL); 602 680 fHSigmaTheta->SetTitle("2D : Sigmabar, \\Theta (reference sample)"); 603 fHSigmaTheta->DrawC lone();681 fHSigmaTheta->DrawCopy(); 604 682 fHSigmaTheta->SetBit(kCanDelete); 605 683 606 684 //c.cd(1); 607 //fHSigmaPixTheta->DrawC lone();685 //fHSigmaPixTheta->DrawCopy(); 608 686 //fHSigmaPixTheta->SetBit(kCanDelete); 609 687 610 688 c.cd(4); 611 fHSigbarTheta->DrawClone(); 689 fHSigbarTheta->SetDirectory(NULL); 690 fHSigbarTheta->DrawCopy(); 612 691 fHSigbarTheta->SetBit(kCanDelete); 613 692 614 693 615 694 c.cd(7); 616 fHNSB->DrawClone(); 695 fHNSB->SetDirectory(NULL); 696 fHNSB->DrawCopy(); 617 697 fHNSB->SetBit(kCanDelete); 618 698 … … 625 705 c.cd(2); 626 706 l = (TH2D*) ((TH3*)fHDiffPixTh)->Project3D("zx"); 627 707 l->SetDirectory(NULL); 628 708 l->SetTitle("Sigma^2-Sigmabar^2 vs. \\Theta (all pixels)"); 629 709 l->SetXTitle("\\Theta [\\circ]"); 630 710 l->SetYTitle("Sigma^2-Sigmabar^2"); 631 711 632 *fLog << "before box" << endl; 633 634 l->Draw("box"); 712 l->DrawCopy("box"); 635 713 l->SetBit(kCanDelete);; 636 714 637 715 c.cd(5); 638 716 l = (TH2D*) ((TH3*)fHDiffPixTh)->Project3D("zy"); 717 l->SetDirectory(NULL); 639 718 l->SetTitle("Sigma^2-Sigmabar^2 vs. pixel number (all \\Theta)"); 640 719 l->SetXTitle("pixel"); 641 720 l->SetYTitle("Sigma^2-Sigmabar^2"); 642 721 643 l->Draw ("box");722 l->DrawCopy("box"); 644 723 l->SetBit(kCanDelete);; 645 724 … … 655 734 c.cd(3); 656 735 k = (TH2D*) ((TH3*)fHSigPixTh)->Project3D("zx"); 736 k->SetDirectory(NULL); 657 737 k->SetTitle("Sigma vs. \\Theta (all pixels)"); 658 738 k->SetXTitle("\\Theta [\\circ]"); 659 739 k->SetYTitle("Sigma"); 660 740 661 k->Draw ("box");741 k->DrawCopy("box"); 662 742 k->SetBit(kCanDelete); 663 743 664 744 c.cd(6); 665 745 k = (TH2D*) ((TH3*)fHSigPixTh)->Project3D("zy"); 746 k->SetDirectory(NULL); 666 747 k->SetTitle("Sigma vs. pixel number (all \\Theta)"); 667 748 k->SetXTitle("pixel"); 668 749 k->SetYTitle("Sigma"); 669 750 670 k->Draw ("box");751 k->DrawCopy("box"); 671 752 k->SetBit(kCanDelete);; 672 753 … … 677 758 678 759 c.cd(10); 679 fHSigmaPedestal->DrawClone(); 760 fHSigmaPedestal->SetDirectory(NULL); 761 fHSigmaPedestal->DrawCopy(); 680 762 fHSigmaPedestal->SetBit(kCanDelete); 681 763 682 764 c.cd(11); 683 fHPhotons->DrawClone(); 765 fHPhotons->SetDirectory(NULL); 766 fHPhotons->DrawCopy(); 684 767 fHPhotons->SetBit(kCanDelete); 685 768
Note:
See TracChangeset
for help on using the changeset viewer.