- Timestamp:
- 03/04/07 11:23:03 (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/mjobs/MJCalibrateSignal.cc
r8310 r8360 18 18 ! Author(s): Thomas Bretz, 1/2004 <mailto:tbretz@astro.uni-wuerzburg.de> 19 19 ! 20 ! Copyright: MAGIC Software Development, 2000-200 420 ! Copyright: MAGIC Software Development, 2000-2007 21 21 ! 22 22 ! … … 53 53 #include "MGeomCam.h" 54 54 #include "MHCamEvent.h" 55 //#include "MHCamEventTH.h"56 55 #include "MPedestalCam.h" 57 56 #include "MBadPixelsCam.h" … … 91 90 #include "MTriggerPatternDecode.h" 92 91 #include "MFTriggerPattern.h" 92 #include "MFilterList.h" 93 93 #include "MGeomApply.h" 94 94 #include "MPedestalSubtract.h" … … 96 96 #include "MPointingPosCalc.h" 97 97 #include "MPedCalcFromLoGain.h" 98 #include "MPedestalSubtract.h" 98 99 #include "MExtractor.h" 99 100 #include "MExtractTimeAndCharge.h" … … 261 262 MHCalibrationRelTimeCam hrelcam; 262 263 //MHCalibrationHiLoCam hilocam; 263 MHCalibrationPulseTimeCam hpulcam;264 //MHCalibrationPulseTimeCam hpulcam; 264 265 265 266 hchacam.SetOscillations(kFALSE); … … 455 456 pedlo3.SetNamePedestalCamOut("MPedestalFromExtractor"); 456 457 457 if (extractor1) 458 { 459 extractor1->SetPedestals(&pedcamab); 460 461 // Setup to use the hi-gain extraction window in the lo-gain 462 // range (the start of the lo-gain range is added automatically 463 // by MPedCalcFromLoGain) 464 // 465 // The window size of the extractor is not yet initialized, 466 // so we have to stick to the extraction range 467 // 468 // Even if we would like to use a range comparable to the 469 // hi-gain extraction we use the lo-gain range to make 470 // sure that exclusions (eg. due to switching noise) 471 // are correctly handled. 472 // 473 const Int_t f = extractor1->GetLoGainFirst(); 474 const Int_t l = extractor1->GetLoGainLast(); 475 const Int_t w = (l-f+1); 476 //const Int_t f = extractor1->GetHiGainFirst(); 477 //const Int_t l = extractor1->GetHiGainLast(); 478 //const Int_t w = (l-f+1)&~1; 479 480 pedlo1.SetExtractWindow(f, w); 481 482 if (extractor1->InheritsFrom("MExtractTimeAndCharge")) 483 { 484 pedlo2.SetExtractor((MExtractTimeAndCharge*)extractor1); 485 pedlo3.SetExtractor((MExtractTimeAndCharge*)extractor1); 486 /* 487 const Int_t win = ((MExtractTimeAndCharge*)extractor1)->GetWindowSizeHiGain(); 488 pedlo1.SetExtractWindow(15, win); 489 pedlo2.SetExtractWindow(15, win//obsolete//); 490 pedlo3.SetExtractWindow(15, win//obsolete//); 491 */ 492 } 493 else 494 { 495 /* 496 // FIXME: How to get the fixed value 15 automatically? 497 const Int_t f = (Int_t)(15.5+extractor1->GetHiGainFirst()); 498 const Int_t n = (Int_t)(15.5+extractor1->GetNumHiGainSamples()); 499 pedlo1.SetExtractWindow(f, n); 500 pedlo2.SetExtractWindow(f, n); 501 pedlo3.SetExtractWindow(f, n); 502 */ 503 pedlo2.SetExtractWindow(f, w); 504 pedlo3.SetExtractWindow(f, w); 505 506 } 507 } 458 if (!extractor1) 459 { 460 *fLog << err << "ERROR - extractor1 == NULL" << endl; 461 return kFALSE; 462 } 463 464 extractor1->SetPedestals(&pedcamab); 465 466 // Setup to use the hi-gain extraction window in the lo-gain 467 // range (the start of the lo-gain range is added automatically 468 // by MPedCalcFromLoGain) 469 // 470 // The window size of the extractor is not yet initialized, 471 // so we have to stick to the extraction range 472 // 473 // Even if we would like to use a range comparable to the 474 // hi-gain extraction we use the lo-gain range to make 475 // sure that exclusions (eg. due to switching noise) 476 // are correctly handled. 477 // 478 pedlo1.SetRangeFromExtractor(*extractor1); 479 480 if (extractor1->InheritsFrom("MExtractTimeAndCharge")) 481 { 482 pedlo2.SetExtractor((MExtractTimeAndCharge*)extractor1); 483 pedlo3.SetExtractor((MExtractTimeAndCharge*)extractor1); 484 } 485 else 486 { 487 pedlo2.SetRangeFromExtractor(*extractor1); 488 pedlo3.SetRangeFromExtractor(*extractor1); 489 } 490 508 491 if (extractor2) 509 extractor2->SetPedestals(&pedcamab);492 extractor2->SetPedestals(&pedcamab); 510 493 511 494 if (extractor3) 512 extractor3->SetPedestals(&pedcamab); 495 extractor3->SetPedestals(&pedcamab); 496 497 //------------------------------ 498 MFTriggerPattern ftp2; 499 ftp2.SetDefault(kTRUE); 500 ftp2.DenyCalibration(); 501 if (!extractor1->HasLoGain()) 502 ftp2.RequirePedestal(); 503 504 pedlo1.SetFilter(&ftp2); 505 pedlo2.SetFilter(&ftp2); 506 pedlo3.SetFilter(&ftp2); 507 508 MContinue contftp2(&ftp2, "ContPedestal"); 509 //------------------------------ 513 510 514 511 MFCosmics fcosmics; … … 525 522 taskenv3.SetDefault(extractor3); 526 523 527 // 524 MFilterList flistftp2("PedestalFilter"); 525 flistftp2.SetInverted(); 526 flistftp2.AddToList(&ftp2); 527 528 if (!extractor1->HasLoGain()) 529 { 530 taskenv1.SetFilter(&flistftp2); 531 taskenv2.SetFilter(&flistftp2); 532 taskenv3.SetFilter(&flistftp2); 533 } 534 535 // 528 536 // This is new calibration to photo-electrons, hard-coded 529 537 // as decided at the Wuerzburg software meeting 26.01.05 … … 531 539 MCalibrateData calib; 532 540 calib.SetSignalType(MCalibrateData::kPhe); 533 calib.AddPedestal("Fundamental");541 //calib.AddPedestal("Fundamental"); 534 542 calib.AddPedestal("FromExtractor"); 535 543 calib.AddPedestal("FromExtractorRndm"); … … 567 575 MFillH filtme(&hrelcam, "MArrivalTimeCam", "FillRelTime"); 568 576 //MFillH filhil(&hilocam, "MExtractedSignalCam", "FillHiLoRatio"); 569 MFillH filpul(&hpulcam, "MRawEvtData", "FillPulseTime");577 //MFillH filpul(&hpulcam, "MRawEvtData", "FillPulseTime"); 570 578 filpin.SetBit(MFillH::kDoNotDisplay); 571 579 filbnd.SetBit(MFillH::kDoNotDisplay); … … 573 581 filtme.SetBit(MFillH::kDoNotDisplay); 574 582 //filhil.SetBit(MFillH::kDoNotDisplay); 575 filpul.SetBit(MFillH::kDoNotDisplay);583 //filpul.SetBit(MFillH::kDoNotDisplay); 576 584 577 585 MCalibrateRelTimes caltm; … … 579 587 MBadPixelsTreat treat; 580 588 581 bpcal.SetNamePedPhotCam("MPedPhotFromExtractor"); 582 treat.AddNamePedPhotCam("MPedPhotFundamental"); 589 //bpcal.SetNamePedPhotCam("MPedPhotFromExtractor"); 590 bpcal.SetNamePedPhotCam("MPedPhotFromExtractorRndm"); 591 592 //treat.AddNamePedPhotCam("MPedPhotFundamental"); 583 593 treat.AddNamePedPhotCam("MPedPhotFromExtractor"); 584 594 treat.AddNamePedPhotCam("MPedPhotFromExtractorRndm"); … … 677 687 tlist2.AddToList(&merge); 678 688 tlist2.AddToList(&pedsub); 689 tlist2.AddToList(&ftp2); 679 690 tlist2.AddToList(&pedlo1); 680 691 tlist2.AddToList(&pedlo2); 681 692 tlist2.AddToList(&pedlo3); 693 682 694 //----------------------------------------------------------- 683 695 … … 709 721 710 722 // Continue for all non-cosmic events 711 tlist2.AddToList(&conttp); 723 tlist2.AddToList(&fill0); // fill pedestal events 724 tlist2.AddToList(&fill1); // fill pedestal events 725 if (!extractor1->HasLoGain()) 726 tlist2.AddToList(&contftp2); // remove pedestal events from processing 727 tlist2.AddToList(&conttp); // remove calib events from processing 712 728 if (extractor1) 713 729 tlist2.AddToList(&taskenv1); 714 730 if (extractor2) 715 731 tlist2.AddToList(&taskenv2); 716 tlist2.AddToList(&fill0);717 tlist2.AddToList(&fill1);718 732 tlist2.AddToList(&contcos); 719 733 /* … … 723 737 tlist2.AddToList(&filhil); 724 738 } 725 */ 739 726 740 if (fIsPulsePosCheck) 727 741 { … … 729 743 tlist2.AddToList(&filpul); 730 744 } 731 745 */ 732 746 tlist2.AddToList(&fill2); 733 747 tlist2.AddToList(&calib); … … 745 759 // tlist2.AddToList(&fill7); 746 760 tlist2.AddToList(&fill9); 747 tlist2.AddToList(&fillR); 748 tlist2.AddToList(&fillO); 749 761 if (extractor1->HasLoGain()) 762 { 763 tlist2.AddToList(&fillR); 764 tlist2.AddToList(&fillO); 765 } 750 766 tlist2.AddToList(&fillflorian); 751 767 … … 800 816 DisplayResult(plist); 801 817 818 /* 802 819 if (fIsPixelCheck) 803 820 { … … 808 825 // hilocam[fCheckedPixId].DrawClone(""); 809 826 } 810 827 */ 811 828 interlacedcont.Add(&pulcam); 812 829 … … 814 831 // interlacedcont.Add(&hilcam); 815 832 816 if (fIsPulsePosCheck)817 interlacedcont.Add(plist.FindObject("MHCalibrationPulseTimeCam"));833 //if (fIsPulsePosCheck) 834 // interlacedcont.Add(plist.FindObject("MHCalibrationPulseTimeCam")); 818 835 819 836 //if (fIsHiLoCalibration)
Note:
See TracChangeset
for help on using the changeset viewer.