Changeset 3446
- Timestamp:
- 03/09/04 19:24:09 (21 years ago)
- Location:
- trunk/MagicSoft/Mars
- Files:
-
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/Changelog
r3445 r3446 47 47 - displaying saturation also for not-valid pixels in GetPixelContent 48 48 49 * msignal/MExtractedSignalCam.[h,cc] 50 * msignal/MExtractSignal.[h,cc] 51 * msignal/MExtractSignal2.[h,cc] 52 * mananlysis/MHPedestalCam.cc 53 * mcalib/MCalibrationChargeCam.cc 54 - in SetUsedFADCSlices, also the window (hi-and logain) is set. 55 This because MExtractSignal2 set the whole window which was much 56 bigger than the actually used one. This bug is now removed. 49 57 50 58 -
trunk/MagicSoft/Mars/manalysis/MHPedestalCam.cc
r3168 r3446 160 160 161 161 162 Float_t slices = (Float_t)signal->GetNumUsedFADCSlices();162 Float_t slices = signal->GetNumUsedHiGainFADCSlices(); 163 163 164 164 if (slices == 0.) -
trunk/MagicSoft/Mars/mcalib/MCalibrationChargeCalc.cc
r3445 r3446 235 235 SETBIT(fFlags, kHiLoGainCalibration); 236 236 237 fNumHiGainSamples = 0 ;238 fNumLoGainSamples = 0 ;237 fNumHiGainSamples = 0.; 238 fNumLoGainSamples = 0.; 239 239 fConversionHiLo = 0; 240 240 … … 336 336 fNumHiGainSamples = fSignals->GetNumUsedHiGainFADCSlices(); 337 337 fNumLoGainSamples = fSignals->GetNumUsedLoGainFADCSlices(); 338 fSqrtHiGainSamples = TMath::Sqrt((Float_t)fNumHiGainSamples); 338 fSqrtHiGainSamples = TMath::Sqrt(fNumHiGainSamples); 339 fSqrtLoGainSamples = TMath::Sqrt(fNumLoGainSamples); 339 340 340 341 UInt_t npixels = fGeom->GetNumPixels(); … … 424 425 { 425 426 pix.SetPedestal(ped * fNumLoGainSamples, 426 prms * TMath::Sqrt((Float_t)fNumLoGainSamples),427 prms * fSqrtLoGainSamples, 427 428 prms * fNumLoGainSamples / num); 428 pix.SetNumLoGainSamples( (Float_t)fNumLoGainSamples);429 pix.SetNumLoGainSamples(fNumLoGainSamples); 429 430 pix.ApplyLoGainConversion(); 430 431 } … … 432 433 { 433 434 pix.SetPedestal(ped * fNumHiGainSamples, 434 prms * TMath::Sqrt((Float_t)fNumHiGainSamples),435 prms * fSqrtHiGainSamples, 435 436 prms * fNumHiGainSamples / num); 436 437 } … … 471 472 { 472 473 avinnerpix->SetPedestal(avinnerped/avinnernum * fNumLoGainSamples, 473 avinnerprms/avinnernum * TMath::Sqrt((Float_t)fNumLoGainSamples),474 avinnerprms/avinnernum * TMath::Sqrt((Float_t)fNumLoGainSamples/avinnernum));475 avinnerpix->SetNumLoGainSamples( (Float_t)fNumLoGainSamples);474 avinnerprms/avinnernum * fSqrtLoGainSamples, 475 avinnerprms/avinnernum * fSqrtLoGainSamples/avinnernum); 476 avinnerpix->SetNumLoGainSamples(fNumLoGainSamples); 476 477 avinnerpix->ApplyLoGainConversion(); 477 478 } … … 479 480 { 480 481 avinnerpix->SetPedestal(avinnerped/avinnernum * fNumHiGainSamples, 481 avinnerprms/avinnernum * TMath::Sqrt((Float_t)fNumHiGainSamples),482 avinnerprms/avinnernum * TMath::Sqrt((Float_t)fNumHiGainSamples/avinnernum));482 avinnerprms/avinnernum * fSqrtHiGainSamples, 483 avinnerprms/avinnernum * fSqrtHiGainSamples/avinnernum); 483 484 } 484 485 … … 486 487 { 487 488 avouterpix->SetPedestal(avouterped/avouternum * fNumLoGainSamples, 488 avouterprms/avouternum * TMath::Sqrt((Float_t)fNumLoGainSamples),489 avouterprms/avouternum * TMath::Sqrt((Float_t)fNumLoGainSamples/avouternum));490 avouterpix->SetNumLoGainSamples( (Float_t)fNumLoGainSamples);489 avouterprms/avouternum * fSqrtLoGainSamples, 490 avouterprms/avouternum * fSqrtLoGainSamples/avouternum); 491 avouterpix->SetNumLoGainSamples(fNumLoGainSamples); 491 492 avouterpix->ApplyLoGainConversion(); 492 493 } … … 494 495 { 495 496 avouterpix->SetPedestal(avouterped/avouternum * fNumHiGainSamples, 496 avouterprms/avouternum * TMath::Sqrt((Float_t)fNumHiGainSamples),497 avouterprms/avouternum * TMath::Sqrt((Float_t)fNumHiGainSamples/avouternum));497 avouterprms/avouternum * fSqrtHiGainSamples, 498 avouterprms/avouternum * fSqrtHiGainSamples/avouternum); 498 499 } 499 500 -
trunk/MagicSoft/Mars/mcalib/MCalibrationChargeCam.cc
r3429 r3446 317 317 << " Reduced Sigma: " << pix->GetRSigmaCharge() 318 318 << " Nr Phe's: " << pix->GetPheFFactorMethod() 319 << " Saturated? :" << pix->IsHiGainSaturation() 319 320 << endl; 320 321 id++; … … 342 343 << " Reduced Sigma: " << pix->GetRSigmaCharge() 343 344 << " Nr Phe's: " << pix->GetPheFFactorMethod() 345 << " Saturated? :" << pix->IsHiGainSaturation() 344 346 << endl; 345 347 id++; … … 366 368 << " Reduced Sigma: " << pix->GetRSigmaCharge() 367 369 << " Nr Phe's: " << pix->GetPheFFactorMethod() 370 << " Saturated? :" << pix->IsHiGainSaturation() 368 371 << endl; 369 372 id++; … … 702 705 break; 703 706 case 34: 704 if ((*this)[idx].IsExcluded() || !(*fBadPixels)[idx].IsCalibrationSignalOK()) 705 return kFALSE; 706 if ((*this)[idx].IsHiGainSaturation()) 707 val = 1; 708 else 709 return kFALSE; 707 if ((*this)[idx].IsExcluded()) 708 return kFALSE; 709 val = (*this)[idx].IsHiGainSaturation(); 710 710 break; 711 711 case 35: -
trunk/MagicSoft/Mars/msignal/MExtractSignal.cc
r3397 r3446 109 109 return kFALSE; 110 110 111 fSignals->SetUsedFADCSlices(fHiGainFirst, fHiGainFirst+fNumHiGainSamples-1, 112 fLoGainFirst, fLoGainFirst+fNumLoGainSamples-1 );111 fSignals->SetUsedFADCSlices(fHiGainFirst, fHiGainFirst+fNumHiGainSamples-1, (Float_t)fNumHiGainSamples, 112 fLoGainFirst, fLoGainFirst+fNumLoGainSamples-1, (Float_t)fNumLoGainSamples); 113 113 114 114 fPedestals = (MPedestalCam*)pList->FindObject(AddSerialNumber("MPedestalCam")); -
trunk/MagicSoft/Mars/msignal/MExtractSignal2.cc
r3397 r3446 77 77 } 78 78 79 void MExtractSignal2::SetRange(Byte_t hifirst, Byte_t hilast, Byte_t lofirst, Byte_t lolast, Byte_t windowsize)79 void MExtractSignal2::SetRange(Byte_t hifirst, Byte_t hilast, Byte_t windowh, Byte_t lofirst, Byte_t lolast, Byte_t windowl) 80 80 { 81 81 … … 86 86 fLoGainFirst = lofirst; 87 87 88 89 fWindowSize = windowsize & ~1; 90 91 if (fWindowSize != windowsize) 92 *fLog << warn << "MExtractSignal2::SetRange - window size has to be even, set to: " << int(fWindowSize) << " samples " << endl; 88 fWindowSizeHiGain = windowh & ~1; 89 fWindowSizeLoGain = windowl & ~1; 90 91 if (fWindowSizeHiGain != windowh) 92 *fLog << warn << "MExtractSignal2::SetRange - Hi Gain window size has to be even, set to: " 93 << int(fWindowSizeHiGain) << " samples " << endl; 93 94 94 if (fWindowSize<2) 95 { 96 fWindowSize = 2; 97 *fLog << warn << "MExtractSignal2::SetRange - window size set to two samples" << endl; 98 } 99 100 if (fWindowSize > fNumHiGainSamples) 101 { 102 fWindowSize = fNumLoGainSamples & ~1; 103 *fLog << warn << "MExtractSignal2::SetRange - window size set to " << int(fWindowSize) << " samples " << endl; 104 } 95 if (fWindowSizeLoGain != windowl) 96 *fLog << warn << "MExtractSignal2::SetRange - Lo Gain window size has to be even, set to: " 97 << int(fWindowSizeLoGain) << " samples " << endl; 105 98 106 if (fWindowSize > fNumLoGainSamples) 107 { 108 fWindowSize = fNumLoGainSamples & ~1; 109 *fLog << warn << "MExtractSignal2::SetRange - window size set to " << int(fWindowSize) << " samples " << endl; 110 } 111 112 fWindowSizeSqrt = TMath::Sqrt((Float_t)fWindowSize); 99 if (fWindowSizeHiGain<2) 100 { 101 fWindowSizeHiGain = 2; 102 *fLog << warn << "MExtractSignal2::SetRange - Hi Gain window size set to two samples" << endl; 103 } 104 105 if (fWindowSizeLoGain<2) 106 { 107 fWindowSizeLoGain = 2; 108 *fLog << warn << "MExtractSignal2::SetRange - Lo Gain window size set to two samples" << endl; 109 } 110 111 if (fWindowSizeHiGain > fNumHiGainSamples) 112 { 113 fWindowSizeHiGain = fNumHiGainSamples & ~1; 114 *fLog << warn << "MExtractSignal2::SetRange - Hi Gain window size set to " 115 << int(fWindowSizeHiGain) << " samples " << endl; 116 } 117 118 if (fWindowSizeLoGain > fNumLoGainSamples) 119 { 120 fWindowSizeLoGain = fNumLoGainSamples & ~1; 121 *fLog << warn << "MExtractSignal2::SetRange - Lo Gain window size set to " 122 << int(fWindowSizeLoGain) << " samples " << endl; 123 } 124 125 fWindowSqrtHiGain = TMath::Sqrt((Float_t)fWindowSizeHiGain); 126 fWindowSqrtLoGain = TMath::Sqrt((Float_t)fWindowSizeLoGain); 113 127 114 128 } … … 141 155 return kFALSE; 142 156 143 fSignals->SetUsedFADCSlices(fHiGainFirst, fHiGainFirst+fNumHiGainSamples-1, 144 fLoGainFirst, fLoGainFirst+fNumLoGainSamples-1 );157 fSignals->SetUsedFADCSlices(fHiGainFirst, fHiGainFirst+fNumHiGainSamples-1, (Float_t)fWindowSizeHiGain, 158 fLoGainFirst, fLoGainFirst+fNumLoGainSamples-1, (Float_t)fWindowSizeLoGain); 145 159 146 160 fPedestals = (MPedestalCam*)pList->FindObject(AddSerialNumber("MPedestalCam")); … … 158 172 } 159 173 160 void MExtractSignal2::FindSignal(Byte_t *ptr, Byte_t size, Int_t &max, Int_t &sat) const174 void MExtractSignal2::FindSignal(Byte_t *ptr, Byte_t size, Byte_t window, Int_t &max, Int_t &sat) const 161 175 { 162 176 const Byte_t *end = ptr + size; … … 169 183 sat = 0; 170 184 Byte_t *p = ptr; 171 while (p<ptr+ fWindowSize)185 while (p<ptr+window) 172 186 { 173 187 sum += *p; … … 189 203 // 190 204 max=sum; 191 for (p=ptr; p+ fWindowSize<end; p++)192 { 193 sum += *(p+ fWindowSize) - *p;205 for (p=ptr; p+window<end; p++) 206 { 207 sum += *(p+window) - *p; 194 208 if (sum>max) 195 209 max = sum; … … 214 228 // 215 229 Int_t sumhi, sathi; 216 FindSignal(pixel.GetHiGainSamples()+fHiGainFirst, fNumHiGainSamples, sumhi, sathi);230 FindSignal(pixel.GetHiGainSamples()+fHiGainFirst, fNumHiGainSamples, fWindowSizeHiGain, sumhi, sathi); 217 231 218 232 Int_t sumlo=0; … … 220 234 if (pixel.HasLoGain()) 221 235 { 222 FindSignal(pixel.GetLoGainSamples()+fLoGainFirst, fNumLoGainSamples, sumlo, satlo);236 FindSignal(pixel.GetLoGainSamples()+fLoGainFirst, fNumLoGainSamples, fWindowSizeLoGain, sumlo, satlo); 223 237 if (satlo) 224 238 sat++; … … 239 253 // Set extracted signal with pedestal substracted 240 254 // 241 pix.SetExtractedSignal(sumhi - pedes*fWindowSize , pedrms*fWindowSizeSqrt,242 sumlo - pedes*fWindowSize , pedrms*fWindowSizeSqrt);255 pix.SetExtractedSignal(sumhi - pedes*fWindowSizeHiGain, pedrms*fWindowSqrtHiGain, 256 sumlo - pedes*fWindowSizeLoGain, pedrms*fWindowSqrtLoGain); 243 257 244 258 pix.SetGainSaturation(sathi, sathi, satlo); -
trunk/MagicSoft/Mars/msignal/MExtractSignal2.h
r3306 r3446 37 37 Byte_t fNumLoGainSamples; // Number of lo gain to be used 38 38 39 Byte_t fWindowSize; // Number of gains in window 40 Float_t fWindowSizeSqrt; // Sqaure root of number of gains in window 39 Byte_t fWindowSizeHiGain; // Number of Hi Gain slices in window 40 Float_t fWindowSqrtHiGain; // Sqaure root of number of Hi Gain slices in window 41 42 Byte_t fWindowSizeLoGain; // Number of Lo Gain slices in window 43 Float_t fWindowSqrtLoGain; // Sqaure root of number of Lo Gain slices in window 41 44 42 45 Byte_t fSaturationLimit; 43 46 44 void FindSignal(Byte_t *ptr, Byte_t size, Int_t &max, Int_t &sat) const;47 void FindSignal(Byte_t *ptr, Byte_t size, Byte_t window, Int_t &max, Int_t &sat) const; 45 48 46 49 Int_t PreProcess(MParList *pList); … … 50 53 MExtractSignal2(const char *name=NULL, const char *title=NULL); 51 54 52 void SetRange(Byte_t hifirst=fgFirst, Byte_t hilast=fgLast, Byte_t lofirst=fgFirst, Byte_t lolast=fgLast, Byte_t window_size=fgWindowSize); 55 void SetRange(Byte_t hifirst=fgFirst, Byte_t hilast=fgLast, Byte_t windowh=fgWindowSize, 56 Byte_t lofirst=fgFirst, Byte_t lolast=fgLast, Byte_t windowl=fgWindowSize); 53 57 void SetSaturationLimit(Byte_t lim) { fSaturationLimit = lim; } 54 58 -
trunk/MagicSoft/Mars/msignal/MExtractedSignalCam.h
r3306 r3446 24 24 Byte_t fLastUsedSliceLoGain; 25 25 26 Float_t fUsedWindowHiGain; 27 Float_t fUsedWindowLoGain; 28 26 29 public: 27 30 … … 36 39 Int_t GetSize() const; 37 40 38 Byte_t GetNumUsedFADCSlices() const { return fLastUsedSliceHiGain-fFirstUsedSliceHiGain+1; } 39 Byte_t GetNumUsedHiGainFADCSlices() const { return fLastUsedSliceHiGain-fFirstUsedSliceHiGain+1; } 40 Byte_t GetNumUsedLoGainFADCSlices() const { return fLastUsedSliceLoGain-fFirstUsedSliceLoGain+1; } 41 Float_t GetNumUsedHiGainFADCSlices() const { return fUsedWindowHiGain; } 42 Float_t GetNumUsedLoGainFADCSlices() const { return fUsedWindowLoGain; } 41 43 42 44 Byte_t GetFirstUsedSliceHiGain() const { return fFirstUsedSliceHiGain; } 43 Byte_t Get LastUsedSliceHiGain() const { return fLastUsedSliceHiGain; }45 Byte_t GetFirstUsedSliceLoGain() const { return fFirstUsedSliceLoGain; } 44 46 45 Byte_t Get FirstUsedSliceLoGain() const { return fFirstUsedSliceLoGain; }46 Byte_t GetLastUsedSliceLoGain() const{ return fLastUsedSliceLoGain; }47 Byte_t GetLastUsedSliceHiGain() const { return fLastUsedSliceHiGain; } 48 Byte_t GetLastUsedSliceLoGain() const { return fLastUsedSliceLoGain; } 47 49 48 void SetUsedFADCSlices(Byte_t firsth, Byte_t lasth, 49 Byte_t firstl, Byte_t lastl )50 void SetUsedFADCSlices(Byte_t firsth, Byte_t lasth, Float_t winh, 51 Byte_t firstl, Byte_t lastl, Float_t winl) 50 52 { 51 53 fFirstUsedSliceHiGain = firsth; 52 54 fLastUsedSliceHiGain = lasth; 55 fUsedWindowHiGain = winh; 53 56 fFirstUsedSliceLoGain = firstl; 54 57 fLastUsedSliceLoGain = lastl; 58 fUsedWindowLoGain = winl; 55 59 } 56 60
Note:
See TracChangeset
for help on using the changeset viewer.