Changeset 9157 for trunk/MagicSoft/Mars/mjobs
- Timestamp:
- 11/12/08 16:16:11 (16 years ago)
- Location:
- trunk/MagicSoft/Mars/mjobs
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/mjobs/MJPedestal.cc
r9143 r9157 77 77 #include "MReadMarsFile.h" 78 78 #include "MRawFileRead.h" 79 #include "MRawEvtData.h"80 79 #include "MGeomApply.h" 80 #include "MContinue.h" 81 81 #include "MPedestalSubtract.h" 82 82 #include "MTriggerPatternDecode.h" … … 85 85 #include "MPedCalcPedRun.h" 86 86 #include "MPedCalcFromLoGain.h" 87 #include "MFTriggerPattern.h"88 87 #include "MBadPixelsCalc.h" 89 88 #include "MPedestalSubtract.h" 89 90 // filter 91 #include "MFilterList.h" 92 #include "MFTriggerPattern.h" 93 #include "MFDataMember.h" 90 94 91 95 // Display helpers … … 114 118 : fExtractor(NULL), fDisplayType(kDisplayDataCheck), 115 119 fExtractType(kUsePedRun), fExtractionType(kFundamental), 116 /*fIsUseHists(kFALSE),*/ fDeadPixelCheck(kFALSE), fMinEvents(50) 120 /*fIsUseHists(kFALSE),*/ fDeadPixelCheck(kFALSE), fMinEvents(50), 121 fMinPedestals(100), fMaxPedestals(0), fMinCosmics(25), fMaxCosmics(100) 117 122 { 118 123 fName = name ? name : "MJPedestal"; … … 682 687 fMinEvents = (UInt_t)GetEnv("MinEvents", (Int_t)fMinEvents); 683 688 689 fMinPedestals = (UInt_t)GetEnv("MinPedestals", (Int_t)fMinPedestals); 690 fMaxPedestals = (UInt_t)GetEnv("MaxPedestals", (Int_t)fMaxPedestals); 691 692 fMinCosmics = (UInt_t)GetEnv("MinCosmics", (Int_t)fMinCosmics); 693 fMaxCosmics = (UInt_t)GetEnv("MaxCosmics", (Int_t)fMaxCosmics); 694 684 695 if (!MJCalib::CheckEnvLocal()) 685 696 return kFALSE; … … 1022 1033 } 1023 1034 1024 // This will make that for data with version less than 5, where1025 // trigger patterns were not yet correct, all the events in the real1026 // data file will be processed. In any case there are no interleaved1027 // calibration events in such data, so this is fine.1028 // The selection is done with the trigger bits before prescaling1029 // Extract pulse position from Lvl1 events.1030 1035 MTriggerPatternDecode decode; 1031 MFTriggerPattern fcalib("SelectCosmics");1032 fcalib.SetDefault(kTRUE);1033 fcalib.DenyAll();1034 fcalib.RequireTriggerLvl1();1035 fcalib.AllowTriggerLvl2();1036 fcalib.AllowSumTrigger();1037 1038 1036 tlist.AddToList(&decode); 1039 1037 … … 1046 1044 tlist.AddToList(&pedsub); 1047 1045 1046 // ---------------------------------------------------------------- 1047 // Setup filter for pulse position extraction and its extraction 1048 1049 // This will make that for data with version less than 5, where 1050 // trigger patterns were not yet correct, all the events in the real 1051 // data file will be processed. In any case there are no interleaved 1052 // calibration events in such data, so this is fine. 1053 // The selection is done with the trigger bits before prescaling 1054 // Extract pulse position from Lvl1 events. 1055 MFTriggerPattern fcos("SelectCosmics"); 1056 fcos.SetDefault(kTRUE); 1057 fcos.DenyAll(); 1058 fcos.RequireTriggerLvl1(); 1059 fcos.AllowTriggerLvl2(); 1060 fcos.AllowSumTrigger(); 1061 1062 // Number of events filled into the histogram presenting the 1063 // trigger area 1064 MFDataMember filterc("MHCalibrationPulseTimeCam.GetNumEvents", '<', fMaxCosmics, "LimitNumCosmics"); 1065 1066 // Combine both filters 1067 MFilterList flistc("&&", "FilterCosmics"); 1068 flistc.AddToList(&fcos); 1069 1070 // For the case the pulse positon check is switched on 1071 // compile the tasklist accordingly 1048 1072 // FIXME: MUX Monte Carlos?!?? 1049 1073 if (fIsPulsePosCheck) 1050 1074 { 1051 fillpul.SetFilter(&fcalib); 1052 tlist.AddToList(&fcalib); 1075 flistc.AddToList(&filterc); 1076 fillpul.SetFilter(&flistc); 1077 1078 tlist.AddToList(&flistc); 1053 1079 tlist.AddToList(&fillpul); 1054 1080 } … … 1059 1085 // tlist.AddToList(&fillC); 1060 1086 1061 // ---------------------------------------------------------------------- 1062 // Now we make sure, that in all cases the ranges are setup correctly 1063 // ---------------------------------------------------------------------- 1064 MTaskEnv taskenv("ExtractPedestal"); 1065 1066 //------------------------------ 1067 // Require that before the Prescaling we had only a pedestal trigger 1087 // ------------------------------------------------------------ 1088 // Setup filter for pedestal extraction 1068 1089 MFTriggerPattern ftp2("SelectPedestals"); 1069 1090 ftp2.SetDefault(kTRUE); … … 1071 1092 ftp2.RequirePedestal(); 1072 1093 1073 // FIXME: WHAT D WE DO IN CASE OF MUX MCs???? 1074 if (!fSequence.IsMonteCarlo() && (!fExtractor || !fExtractor->HasLoGain())) 1075 { 1076 taskenv.SetFilter(&ftp2); 1077 tlist.AddToList(&ftp2); 1078 } 1079 //------------------------------ 1080 1081 switch (fExtractType) 1082 { 1083 case kUsePedRun: 1084 // In case other than 'fundamental' second argument is obsolete 1085 // pedcalc.SetExtractWindow(0,14); // kUsePedRun (take default from class) 1086 taskenv.SetDefault(&pedcalc); 1087 tlist.AddToList(&taskenv); 1088 break; 1089 1090 case kUseData: 1091 // In case other than 'fundamental' second argument is obsolete 1092 // pedlogain.SetExtractWindow(15,14); // kUseData (take default from class) 1093 taskenv.SetDefault(&pedlogain); 1094 tlist.AddToList(&taskenv); 1095 break; 1096 } 1094 // Limit number of events from which a pedestal is extracted 1095 MFDataMember filterp(Form("%s.fNumEvents", fPedestalCamOut.GetName()), '<', fMaxPedestals, "LimitNumPedestal"); 1096 1097 // Combine both filters together 1098 MFilterList flistp("&&", "FilterPedestal"); 1099 // If data is not MC and has no lo-gains select pedestals from trigger pattern 1100 if (!fSequence.IsMonteCarlo() && !(fExtractor && fExtractor->HasLoGain())) 1101 flistp.AddToList(&ftp2); 1102 if (fMaxPedestals>0) 1103 flistp.AddToList(&filterp); 1104 1105 // ------------------------------------------------------------ 1106 // Setup pedestal extraction 1107 MTaskEnv taskenv("ExtractPedestal"); 1108 1109 taskenv.SetDefault(fExtractType==kUsePedRun ? 1110 static_cast<MTask*>(&pedcalc) : 1111 static_cast<MTask*>(&pedlogain)); 1112 1113 taskenv.SetFilter(&flistp); 1114 tlist.AddToList(&flistp); 1115 tlist.AddToList(&taskenv); 1116 1117 // ------------------------------------------------------------ 1118 // Setup a filter which defines when the loop is stopped 1119 MFilterList flist("||"); 1120 flist.SetInverted(); 1121 if (fMaxPedestals>0) 1122 flist.AddToList(&filterp); 1123 if (fIsPulsePosCheck && fMaxCosmics>0) 1124 flist.AddToList(&filterc); 1125 1126 MContinue stop(&flist, "Stop"); 1127 stop.SetRc(kFALSE); 1128 if (flist.GetNumEntries()>0) 1129 tlist.AddToList(&stop); 1130 1097 1131 /* 1098 1132 if (fIsUseHists && fExtractor) … … 1186 1220 } 1187 1221 1222 if (fIsPulsePosCheck && pulcam.GetNumEvents()<fMinCosmics) 1223 { 1224 *fLog << err << GetDescriptor() << ": Failed. Less than the required " << fMinCosmics << " cosmics evts processed." << endl; 1225 return kFALSE; 1226 } 1227 1228 if (fPedestalCamOut.GetNumEvents()<fMinPedestals) 1229 { 1230 *fLog << err << GetDescriptor() << ": Failed. Less than the required " << fMinPedestals << " pedetsl evts processed." << endl; 1231 return kFALSE; 1232 } 1233 1188 1234 if (fDeadPixelCheck) 1189 1235 { -
trunk/MagicSoft/Mars/mjobs/MJPedestal.h
r8990 r9157 75 75 76 76 UInt_t fMinEvents; // Minimum number of events 77 UInt_t fMinPedestals; // Minimum number of events 78 UInt_t fMaxPedestals; // Maximum number of events for pedestal extraction 79 UInt_t fMinCosmics; // Minimum number of events 80 UInt_t fMaxCosmics; // Maximum number of events for pulse extraction 77 81 78 82 MExtractor *ReadCalibration(); -
trunk/MagicSoft/Mars/mjobs/MJStar.cc
r9028 r9157 411 411 MFillH fillsp("MHSrcPosCam", "MSrcPosCam", "FillSrcPosCam"); 412 412 fillsp.SetNameTab("Src"); 413 tlist2.AddToList(&fillsp); 413 if (fSequence.IsMonteCarlo()) 414 tlist2.AddToList(&fillsp); 414 415 415 416
Note:
See TracChangeset
for help on using the changeset viewer.