Changeset 8894 for trunk/MagicSoft/Mars/mjobs/MJCalibrateSignal.cc
- Timestamp:
- 05/20/08 14:14:27 (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/mjobs/MJCalibrateSignal.cc
r8795 r8894 18 18 ! Author(s): Thomas Bretz, 1/2004 <mailto:tbretz@astro.uni-wuerzburg.de> 19 19 ! 20 ! Copyright: MAGIC Software Development, 2000-200 720 ! Copyright: MAGIC Software Development, 2000-2008 21 21 ! 22 22 ! … … 59 59 60 60 // General histograms 61 #include "MH3.h" 61 62 #include "MHCamEvent.h" 62 63 #include "MHVsTime.h" … … 227 228 } 228 229 230 #include "MParameterCalc.h" // FIXME 229 231 Bool_t MJCalibrateSignal::Process(MPedestalCam &pedcamab, MPedestalCam &pedcambias, 230 232 MPedestalCam &pedcamextr) … … 401 403 MTriggerPatternDecode decode; 402 404 405 MH3 hpat("MRawRunHeader.fRunNumber", "MTriggerPattern.GetUnprescaled"); 406 hpat.SetWeight("1./MRawRunHeader.GetRunLength"); 407 hpat.SetName("TrigPat"); 408 hpat.SetTitle("Rate of the trigger pattern [Hz];Run Number;Trigger Pattern;Rate [Hz]"); 409 hpat.InitLabels(MH3::kLabelsXY); 410 //hpat.DefineLabelsY("1=Lvl1;2=Cal;3=Cal;4=Lvl2;5=Cal;7=Cal;8=Ped;9=Ped+Trig;13=Ped+Trig;16=Pin;32=Sum"); 411 hpat.DefaultLabelY("UNKNOWN"); 412 hpat.DefineLabelY( 0, "0"); // 0: No pattern 413 hpat.DefineLabelY( 1, "Trig"); // Lvl1 414 hpat.DefineLabelY( 2, "Cal"); // Cal 415 hpat.DefineLabelY( 3, "Cal"); // Cal+Lvl1 416 hpat.DefineLabelY( 4, "Trig"); // Lvl2 417 hpat.DefineLabelY( 5, "Trig"); // Lvl1+Lvl2 418 hpat.DefineLabelY( 7, "Cal"); // Cal+Lvl1+Lvl2 419 hpat.DefineLabelY( 8, "Ped"); // Ped 420 hpat.DefineLabelY( 9, "Ped+Trig"); // Ped+Lvl1 421 hpat.DefineLabelY(13, "Ped+Trig"); // Ped+Lvl2 422 hpat.DefineLabelY(16, "Pin"); 423 hpat.DefineLabelY(32, "Sum"); // Sum 424 hpat.DefineLabelY(33, "Sum"); // Sum+Lvl1 425 hpat.DefineLabelY(37, "Sum"); // Sum+Lvl1+Lvl2 426 427 MFillH fillpat(&hpat, "", "FillPattern"); 428 fillpat.SetDrawOption("box"); 429 403 430 // This will make that for data with version less than 5, where 404 431 // trigger patterns were not yet correct, all the events in the real 405 432 // data file will be processed. In any case there are no interleaved 406 433 // calibration events in such data, so this is fine. 407 MFTriggerPattern ftp; 408 ftp.SetDefault(kTRUE); 434 MFTriggerPattern fcalped; 435 fcalped.SetInverted(); 436 fcalped.SetDefault(kTRUE); 409 437 // ftp.RequireCalibration(); 410 f tp.DenyCalibration();411 f tp.DenyPedestal();438 fcalped.DenyCalibration(); 439 fcalped.DenyPedestal(); 412 440 // ftp.DenyPinDiode(); 413 ftp.SetInverted(); 414 415 // This will skip interleaved calibration events and pedestal events (if any) 416 // --> tlist2 417 MContinue conttp(&ftp, "ContTrigPattern"); 441 442 // This will skip interleaved events with a cal- or ped-trigger 443 MContinue contcalped(&fcalped, "ContTrigPattern"); 418 444 419 445 // Create the pedestal subtracted raw-data … … 468 494 469 495 //------------------------------ 470 MFTriggerPattern f tp2;471 f tp2.SetDefault(kTRUE);472 f tp2.DenyCalibration();496 MFTriggerPattern fped; 497 fped.SetDefault(kTRUE); 498 fped.DenyCalibration(); 473 499 if (!extractor1->HasLoGain()) 474 ftp2.RequirePedestal(); 475 476 pedlo1.SetFilter(&ftp2); 477 pedlo2.SetFilter(&ftp2); 478 pedlo3.SetFilter(&ftp2); 479 480 MContinue contftp2(&ftp2, "ContPedestal"); 500 { 501 fped.RequirePedestal(); 502 fped.DenyTriggerLvl1(); 503 fped.DenyTriggerLvl2(); 504 } 505 481 506 //------------------------------ 482 507 … … 493 518 taskenv2.SetDefault(extractor2); 494 519 taskenv3.SetDefault(extractor3); 495 496 MFilterList flistftp2("PedestalFilter");497 flistftp2.SetInverted();498 flistftp2.AddToList(&ftp2);499 500 if (!extractor1->HasLoGain())501 {502 taskenv1.SetFilter(&flistftp2);503 taskenv2.SetFilter(&flistftp2);504 taskenv3.SetFilter(&flistftp2);505 }506 520 507 521 // … … 523 537 fcalib.SetDefault(kFALSE); 524 538 fcalib.RequireCalibration(); 539 //fcalib.DenyPedestal(); // This should never happen! 525 540 526 541 MCalibrationChargeCalc chcalc; … … 617 632 fillP.SetNameTab("Pulse"); 618 633 */ 619 620 if (!extractor1->HasLoGain())621 {622 fill0.SetFilter(&ftp2);623 fill1.SetFilter(&ftp2);624 }625 634 626 635 /* … … 693 702 */ 694 703 695 // Now setup tasklist for events 704 //----------------------------------------------------------- 705 // Build tasklist 706 696 707 MTaskList tlist2; 697 708 698 709 tlist2.AddToList(&caldec); 699 710 tlist2.AddToList(&decode); 711 tlist2.AddToList(&fillpat); 700 712 tlist2.AddToList(&apply); 701 713 //tlist2.AddToList(&merge); 702 714 tlist2.AddToList(&pedsub); 703 tlist2.AddToList(&ftp2);704 tlist2.AddToList(&pedlo1);705 tlist2.AddToList(&pedlo2);706 tlist2.AddToList(&pedlo3);707 tlist2.AddToList(&fill0); // fill pedestal events708 tlist2.AddToList(&fill1); // fill pedestal events709 715 710 716 //----------------------------------------------------------- 717 // Pedestal extraction 711 718 712 719 MTaskList tlist3; 713 tlist3.SetFilter(&fcalib); 720 tlist3.SetFilter(&fped); // Deny events with cal-trigger 721 722 tlist2.AddToList(&fped); // If no lo-gain require ped-trigger 723 tlist2.AddToList(&tlist3); // and deny cosmics (lvl1/2) trigger 724 725 tlist3.AddToList(&pedlo1); // extract pedestal events 726 tlist3.AddToList(&pedlo2); // extract pedestal events 727 tlist3.AddToList(&pedlo3); // extract pedestal events 728 tlist3.AddToList(&fill0); // fill pedestal events 729 tlist3.AddToList(&fill1); // fill pedestal events 730 731 //----------------------------------------------------------- 732 // Calibration 733 734 MTaskList tlist4; 735 tlist4.SetFilter(&fcalib); // process only events with cal-trigger 714 736 715 737 //MFDataPhrase filcalco("MCalibrationConstCam.IsReadyToSave>0.5", "CalibConstFilter"); … … 717 739 { 718 740 tlist2.AddToList(&fcalib); // MFTriggerPattern 719 tlist2.AddToList(&tlist 3);741 tlist2.AddToList(&tlist4); 720 742 if (IsUsePINDiode()) 721 tlist 3.AddToList(&pinext); // MExtractPINDiode743 tlist4.AddToList(&pinext); // MExtractPINDiode 722 744 if (IsUseBlindPixel()) 723 tlist 3.AddToList(&bldext); // MExtractBlindPixel724 tlist 3.AddToList(&taskenv3);725 tlist 3.AddToList(&pacalc); // MCalibCalcFromPast745 tlist4.AddToList(&bldext); // MExtractBlindPixel 746 tlist4.AddToList(&taskenv3); 747 tlist4.AddToList(&pacalc); // MCalibCalcFromPast 726 748 /* 727 749 tlist3.AddToList(&filcalco); // CalibConstFilter (IsReadyToSave) … … 730 752 */ 731 753 732 tlist 3.AddToList(&filcam); // FillChargeCam754 tlist4.AddToList(&filcam); // FillChargeCam 733 755 if (fIsRelTimesUpdate) 734 tlist 3.AddToList(&filtme); // FillRelTime756 tlist4.AddToList(&filtme); // FillRelTime 735 757 if (IsUseBlindPixel()) 736 tlist 3.AddToList(&filbnd); // FillBlindCam758 tlist4.AddToList(&filbnd); // FillBlindCam 737 759 if (IsUsePINDiode()) 738 tlist 3.AddToList(&filpin); // FillPINDiode739 tlist 3.AddToList(&chcalc); // MCalibrationChargeCalc760 tlist4.AddToList(&filpin); // FillPINDiode 761 tlist4.AddToList(&chcalc); // MCalibrationChargeCalc 740 762 if (fIsRelTimesUpdate) 741 tlist 3.AddToList(&recalc); // MCalibrationRelTimeCam763 tlist4.AddToList(&recalc); // MCalibrationRelTimeCam 742 764 743 765 //tlist3.AddToList(&writecal); // MWriteRootFile 744 766 } 745 767 746 // Continue for all non-cosmic events 747 if (!extractor1->HasLoGain()) 748 tlist2.AddToList(&contftp2); // remove pedestal events from processing 749 tlist2.AddToList(&conttp); // remove calib events from processing 768 //----------------------------------------------------------- 769 // Cosmics extraction 770 771 // remove all events with a cal- or ped-trigger (no matter 772 // whether they have lvl1 or lvl2 or any other flag 773 tlist2.AddToList(&contcalped); 774 775 // Extract the signal 750 776 if (extractor1) 751 777 tlist2.AddToList(&taskenv1); 778 779 // remove all events which definitly don#t have a signal 780 // using MFCosmics (ContTrigEvts) 781 tlist2.AddToList(&contcos); 782 783 // Extract arrival time (if a dedicated extrator given) 752 784 if (extractor2) 753 tlist2.AddToList(&taskenv2);754 tlist2.AddToList(&contcos); // MFCosmics (ContTrigEvts) 785 tlist2.AddToList(&taskenv2); 786 755 787 /* 756 788 if (fIsHiLoCalibration) … … 766 798 } 767 799 */ 800 768 801 tlist2.AddToList(&fill2); 769 802 tlist2.AddToList(&fill8); // FillConv
Note:
See TracChangeset
for help on using the changeset viewer.