Changeset 8154 for trunk/MagicSoft/Mars/mjobs
- Timestamp:
- 10/24/06 09:26:10 (18 years ago)
- Location:
- trunk/MagicSoft/Mars/mjobs
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/mjobs/MJCalibrateSignal.cc
r8141 r8154 94 94 #include "MFTriggerPattern.h" 95 95 #include "MGeomApply.h" 96 #include "MPedestalSubtract.h" 96 97 //#include "MMcPedestalCopy.h" 97 98 #include "MPointingPosCalc.h" … … 450 451 MContinue conttp(&ftp, "ContTrigPattern"); 451 452 453 // Create the pedestal subtracted raw-data 454 MPedestalSubtract pedsub; 455 pedsub.SetPedestalCam(&pedcamab); 456 452 457 // Do signal and pedestal calculation 453 458 MPedCalcFromLoGain pedlo1("MPedCalcFundamental"); … … 471 476 extractor1->SetPedestals(&pedcamab); 472 477 478 // Setup to use the hi-gain extraction window in the lo-gain 479 // range (the start of the lo-gain range is added automatically 480 // by MPedCalcFromLoGain) 481 // 482 // The window size of the extractor is not yet initialized, 483 // so we have to stick to the extraction range 484 const Int_t f = extractor1->GetHiGainFirst(); 485 const Int_t l = extractor1->GetHiGainLast(); 486 const Int_t w = (l-f+1)&~1; 487 488 pedlo1.SetExtractWindow(f, w); 489 473 490 if (extractor1->InheritsFrom("MExtractTimeAndCharge")) 474 491 { 475 492 pedlo2.SetExtractor((MExtractTimeAndCharge*)extractor1); 476 493 pedlo3.SetExtractor((MExtractTimeAndCharge*)extractor1); 494 /* 477 495 const Int_t win = ((MExtractTimeAndCharge*)extractor1)->GetWindowSizeHiGain(); 478 496 pedlo1.SetExtractWindow(15, win); 479 pedlo2.SetExtractWindow(15, win/*obsolete*/); 480 pedlo3.SetExtractWindow(15, win/*obsolete*/); 497 pedlo2.SetExtractWindow(15, win//obsolete//); 498 pedlo3.SetExtractWindow(15, win//obsolete//); 499 */ 481 500 } 482 501 else 483 502 { 503 /* 484 504 // FIXME: How to get the fixed value 15 automatically? 485 505 const Int_t f = (Int_t)(15.5+extractor1->GetHiGainFirst()); … … 488 508 pedlo2.SetExtractWindow(f, n); 489 509 pedlo3.SetExtractWindow(f, n); 510 */ 511 pedlo2.SetExtractWindow(f, w); 512 pedlo3.SetExtractWindow(f, w); 513 490 514 } 491 515 } … … 657 681 tlist2.AddToList(&apply); 658 682 tlist2.AddToList(&merge); 683 tlist2.AddToList(&pedsub); 659 684 tlist2.AddToList(&pedlo1); 660 685 tlist2.AddToList(&pedlo2); -
trunk/MagicSoft/Mars/mjobs/MJCalibration.cc
r8141 r8154 154 154 #include "MRawFileRead.h" 155 155 #include "MGeomApply.h" 156 #include "MPedestalSubtract.h" 156 157 #include "MTaskEnv.h" 157 158 #include "MBadPixelsMerge.h" … … 1907 1908 tlist.AddToList(&apply); 1908 1909 1909 MPedCalcPedRun pedcalc; 1910 pedcalc.SetExtractWindow(fExtractor->GetHiGainFirst(),TMath::Nint(fExtractor->GetNumHiGainSamples())); 1910 // Produce pedestal subtracted raw-data 1911 MPedestalSubtract pedsub; 1912 pedsub.SetPedestalCam(fExtractor->GetPedestals()); 1913 tlist.AddToList(&pedsub); 1914 1915 // Setup to use the hi-gain extraction window in the lo-gain 1916 // range (the start of the lo-gain range is added automatically 1917 // by MPedCalcFromLoGain) 1918 // 1919 // The window size of the extractor is not yet initialized, 1920 // so we have to stick to the extraction range 1921 const Int_t f = fExtractor->GetHiGainFirst(); 1922 const Int_t l = fExtractor->GetHiGainLast(); 1923 const Int_t w = (l-f+1)&~1; 1924 1925 MPedCalcPedRun pedcalc; 1926 pedcalc.SetExtractWindow(f, w); 1911 1927 1912 1928 if (IsIntensity()) -
trunk/MagicSoft/Mars/mjobs/MJPedestal.cc
r7739 r8154 82 82 #include "MRawEvtData.h" 83 83 #include "MGeomApply.h" 84 #include "MPedestalSubtract.h" 84 85 #include "MTriggerPatternDecode.h" 85 86 #include "MBadPixelsMerge.h" … … 1064 1065 // 1065 1066 if (!fBadPixelsFile.IsNull()) 1066 1067 { 1067 1068 *fLog << inf << "Excluding: " << fBadPixelsFile << endl; 1068 ifstream fin(fBadPixelsFile .Data());1069 fBadPixels.AsciiRead( (istream&)fin);1070 1069 ifstream fin(fBadPixelsFile); 1070 fBadPixels.AsciiRead(fin); 1071 } 1071 1072 1072 1073 MGeomApply geomapl; … … 1074 1075 1075 1076 MPedCalcPedRun pedcalc; 1076 pedcalc.SetPedestalUpdate(kFALSE);1077 //pedcalc.SetPedestalUpdate(kFALSE); 1077 1078 1078 1079 MPedCalcFromLoGain pedlogain; … … 1132 1133 tlist.AddToList(&fillpul); 1133 1134 } 1135 1136 // produce pedestal subtracted raw-data 1137 MPedestalSubtract pedsub; 1138 if (fExtractor && fExtractionType!=kFundamental) 1139 pedsub.SetPedestalCam(&fPedestalCamIn); 1140 else 1141 pedsub.SetNamePedestalCam(""); // Only copy hi- and lo-gain together! 1142 tlist.AddToList(&pedsub); 1134 1143 1135 1144 // ---------------------------------------------------------------------- … … 1186 1195 if (fExtractor) 1187 1196 { 1188 fExtractor->SetPedestals(&fPedestalCamIn);1189 1190 if (fExtractionType!=kFundamental)1197 fExtractor->SetPedestals(&fPedestalCamIn); 1198 1199 if (fExtractionType!=kFundamental) 1191 1200 { 1192 pedcalc.SetRandomCalculation(fExtractionType==kWithExtractorRndm);1193 pedlogain.SetRandomCalculation(fExtractionType==kWithExtractorRndm);1194 1195 pedcalc.SetExtractor((MExtractTimeAndCharge*)fExtractor);1196 pedlogain.SetExtractor((MExtractTimeAndCharge*)fExtractor);1201 pedcalc.SetRandomCalculation(fExtractionType==kWithExtractorRndm); 1202 pedlogain.SetRandomCalculation(fExtractionType==kWithExtractorRndm); 1203 1204 pedcalc.SetExtractor((MExtractTimeAndCharge*)fExtractor); 1205 pedlogain.SetExtractor((MExtractTimeAndCharge*)fExtractor); 1197 1206 } 1198 1199 if (fExtractor->InheritsFrom("MExtractTimeAndCharge")) 1207 else 1200 1208 { 1201 1202 const Float_t f = 0.1+fExtractor->GetHiGainFirst(); 1203 const Int_t win = ((MExtractTimeAndCharge*)fExtractor)->GetWindowSizeHiGain(); 1204 pedcalc.SetExtractWindow((Int_t)f, win); 1205 pedlogain.SetExtractWindow((Int_t)(15+f), win); 1206 1209 // The window size of the extractor is not yet initialized, 1210 // so we have to stick to the extraction range 1211 const Int_t f = fExtractor->GetHiGainFirst(); 1212 const Int_t l = fExtractor->GetHiGainLast(); 1213 const Int_t w = (l-f+1)&~1; 1214 1215 // Setup to use the hi-gain extraction window in the lo-gain 1216 // range (the start of the lo-gain range is added automatically 1217 // by MPedCalcFromLoGain) 1218 pedcalc.SetExtractWindow(f, w); 1219 pedlogain.SetExtractWindow(f, w); 1207 1220 } 1208 else 1221 1222 if (!fExtractor->InheritsFrom("MExtractTimeAndCharge") && fExtractionType!=kFundamental) 1209 1223 { 1210 const Float_t f = 0.1+fExtractor->GetHiGainFirst(); 1211 const Float_t n = 0.1+fExtractor->GetNumHiGainSamples(); 1212 pedcalc.SetExtractWindow((Int_t)f, (Int_t)n); 1213 pedlogain.SetExtractWindow((Int_t)(15+f), (Int_t)n); 1214 1215 if (fExtractionType!=kFundamental) 1216 { 1217 *fLog << inf; 1218 *fLog << "Signal extractor doesn't inherit from MExtractTimeAndCharge..." << endl; 1219 *fLog << " --> falling back to fundamental pedestal extraction." << endl; 1220 fExtractionType=kFundamental; 1221 } 1224 *fLog << inf; 1225 *fLog << "Signal extractor doesn't inherit from MExtractTimeAndCharge..." << endl; 1226 *fLog << " --> falling back to fundamental pedestal extraction." << endl; 1227 fExtractionType=kFundamental; 1222 1228 } 1223 1229 }
Note:
See TracChangeset
for help on using the changeset viewer.