Changeset 8618 for trunk/MagicSoft/Mars/mjobs/MJCut.cc
- Timestamp:
- 06/28/07 21:30:25 (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/mjobs/MJCut.cc
r8590 r8618 89 89 MJCut::MJCut(const char *name, const char *title) 90 90 : fStoreSummary(kFALSE), fStoreResult(kTRUE), fWriteOnly(kFALSE), 91 fFullDisplay(kTRUE), 92 f RndmSrcPos(kFALSE), fNameHist("MHThetaSq"),91 fFullDisplay(kTRUE), fRndmSrcPos(kFALSE), fNumOffSourcePos(3), 92 fNameHist("MHThetaSq"), 93 93 fCalcHadronness(0), fCalcDisp(0), fEstimateEnergy(0) 94 94 { … … 347 347 EnableFullDisplay(GetEnv("FullDisplay", fFullDisplay)); 348 348 EnableRandomSrcPos(GetEnv("RandomSourcePosition", fRndmSrcPos)); 349 350 fNumOffSourcePos = GetEnv("NumOffSourcePositions", (Int_t)fNumOffSourcePos); 349 351 //EnableSubstraction(GetEnv("HistogramSubstraction", fSubstraction)); 350 352 … … 626 628 // -------------------------------------------------------------------------------- 627 629 630 MParameterD scale; 631 scale.SetVal(1./fNumOffSourcePos); 632 628 633 // Setup fitter and histograms 629 634 MAlphaFitter fit; 630 635 plist.AddToList(&fit); 631 636 if (set.IsWobbleMode()) 637 { 632 638 fit.SetScaleMode(MAlphaFitter::kNone); 639 fit.SetScaleUser(1./fNumOffSourcePos); 640 } 633 641 634 642 MHAlpha *halphaoff = CreateNewHist(plist, "Off"); … … 638 646 639 647 // FIXME: If fPathIn read cuts and energy estimator from file! 648 MContinue contq("", "CutQ"); 640 649 MContinue cont0("", "Cut0"); 641 650 MContinue cont1("", "Cut1"); 642 651 MContinue cont2("", "Cut2"); 643 652 MContinue cont3("", "Cut3"); 653 contq.SetAllowEmpty(); 644 654 cont0.SetAllowEmpty(); 645 655 cont1.SetAllowEmpty(); … … 691 701 setrunnum.SetNameParameter("RunNumber"); 692 702 693 // MFillH fill0a("OnPos [MHSrcPosCam]", "MSrcPosCam", "FillSrcPosCam");694 703 MFillH fill1a("MHHillasOffPre [MHHillas]", "MHillas", "FillHillasPre"); 695 704 MFillH fill2a("MHHillasOffPost [MHHillas]", "MHillas", "FillHillasPost"); … … 715 724 print2.EnableSkip(); 716 725 726 MTaskList tlist2; 727 if (set.IsWobbleMode()) 728 { 729 tlist2.SetNumPasses(fNumOffSourcePos); 730 fill2a.SetWeight(&scale); 731 fill3a.SetWeight(&scale); 732 fill4a.SetWeight(&scale); 733 fill5a.SetWeight(&scale); 734 fill6a.SetWeight(&scale); 735 fill7a.SetWeight(&scale); 736 } 737 717 738 // How to get source position from off- and on-data? 718 739 MSrcPosCalc scalc; 719 740 scalc.SetMode(set.IsWobbleMode()?MSrcPosCalc::kWobble:MSrcPosCalc::kOffData); /********************/ 741 scalc.SetCallback(&tlist2); 720 742 721 743 MSrcPosCorrect scor; … … 730 752 MSrcPosRndm srcrndm; 731 753 732 MTaskList tlist2;733 754 tlist2.AddToList(&scalc); 734 755 tlist2.AddToList(&scor); 735 756 tlist2.AddToList(&srcrndm); 736 //if (fRndmSrcPos && !set.IsWobbleMode())737 // tlist2.AddToList(&fill0a);738 757 tlist2.AddToList(&hcalc); 739 758 if (set.IsWobbleMode()) 740 759 tlist2.AddToList(&hcalc2); 741 760 //tlist2.AddToList(&taskenv1); 742 tlist2.AddToList(&cont0); 761 tlist2.AddToList(&cont0); 743 762 tlist2.AddToList(&taskenv2); 744 763 tlist2.AddToList(&taskenv3); … … 747 766 if (write0) 748 767 tlist2.AddToList(write0); 749 if (!fWriteOnly)750 tlist2.AddToList(&fill1a);751 768 tlist2.AddToList(&cont1); 752 769 if (!fWriteOnly && (!set.IsWobbleMode() || !fNameHistFS.IsNull())) … … 786 803 tlist.AddToList(&print2, "EffectiveOnTime"); 787 804 tlist.AddToList(&devcalc, "Starguider"); 805 tlist.AddToList(&contq, "Events"); 806 if (!fWriteOnly) 807 tlist.AddToList(&fill1a, "Events"); 788 808 tlist.AddToList(&tlist2, "Events"); 789 809 … … 802 822 803 823 TObjArray cont; 824 cont.Add(&contq); 804 825 cont.Add(&cont0); 805 826 cont.Add(&cont1); … … 879 900 fill6b.SetDrawOption(set.HasOffSequences()||set.IsWobbleMode()?"same":""); 880 901 fill7b.SetDrawOption(set.HasOffSequences()||set.IsWobbleMode()?"same":""); 881 882 902 //fill9b.SetFilter(&fbin); 883 903 … … 922 942 fillphi.SetDrawOption("anticut"); 923 943 944 tlist2.SetNumPasses(); 945 924 946 tlist.Replace(&readon); 925 947 if (fRndmSrcPos && !set.IsWobbleMode()) 926 {927 // tlist2.RemoveFromList(&fill0a);928 948 tlist2.RemoveFromList(&srcrndm); 929 }930 949 931 950 MFillH fillsrc(&hsrcpos, "MSrcPosCam", "FillSrcPosCam"); … … 936 955 if (!fWriteOnly) 937 956 { 938 tlist 2.Replace(&fill1b);957 tlist.Replace(&fill1b); 939 958 /* if (fIsWobble) 940 959 {
Note:
See TracChangeset
for help on using the changeset viewer.