Changeset 5373
- Timestamp:
- 11/10/04 18:01:46 (20 years ago)
- Location:
- trunk/MagicSoft/Mars
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/Changelog
r5371 r5373 34 34 relatively good precision although still the extensive test with 35 35 the noise calculation from the extractor directly is missing. 36 - subtract the pedestal right at the beginning instead of twice 37 during execution of the filter. 38 39 * msignal/MExtractTimeAndChargeSpline.cc 40 - added treatment of IsNoiseCalculation() for the "integral" 41 method. 42 36 43 37 44 2004/11/10: Abelardo Moralejo -
trunk/MagicSoft/Mars/msignal/MExtractTimeAndChargeDigitalFilter.cc
r5368 r5373 228 228 229 229 // 230 // Check for saturation in all other slices 231 // 232 while (p<end) 233 { 234 235 fHiGainSignal[count++] = (Float_t)*p; 236 237 if (*p > max) 238 { 239 max = *p; 240 maxpos = p-ptr; 241 } 242 243 if (*p++ >= fSaturationLimit) 244 sat++; 245 } 246 247 if (fHiLoLast != 0) 248 { 249 250 end = logain + fHiLoLast; 251 252 while (logain<end) 253 { 254 255 fHiGainSignal[count++] = (Float_t)*logain; 256 range++; 257 258 if (*logain > max) 259 { 260 max = *logain; 261 maxpos = range; 262 } 263 264 if (*logain++ >= fSaturationLimit) 265 sat++; 266 } 267 } 268 269 // 270 // allow one saturated slice 271 // 272 if (sat > 0) 273 return; 274 275 Float_t time_sum = 0.; 276 Float_t fmax = 0.; 277 Float_t ftime_max = 0.; 278 Int_t max_p = 0; 279 230 // Preparations for the pedestal subtraction (with AB-noise correction) 231 // 280 232 const Float_t pedes = ped.GetPedestal(); 281 233 const Float_t ABoffs = ped.GetPedestalABoffset(); … … 286 238 287 239 // 240 // Check for saturation in all other slices 241 // 242 while (p<end) 243 { 244 245 const Int_t ids = fHiGainFirst + count ; 246 const Float_t signal = (Float_t)*p - pedmean[(ids+abflag) & 0x1]; 247 fHiGainSignal[count] = signal; 248 249 count++; 250 251 if (*p > max) 252 { 253 max = *p; 254 maxpos = p-ptr; 255 } 256 257 if (*p++ >= fSaturationLimit) 258 sat++; 259 } 260 261 if (fHiLoLast != 0) 262 { 263 264 end = logain + fHiLoLast; 265 266 while (logain<end) 267 { 268 269 const Int_t ids = fHiGainFirst + range ; 270 const Float_t signal = (Float_t)*logain - pedmean[(ids+abflag) & 0x1]; 271 fHiGainSignal[range] = signal; 272 range++; 273 274 if (*logain > max) 275 { 276 max = *logain; 277 maxpos = range; 278 } 279 280 if (*logain++ >= fSaturationLimit) 281 sat++; 282 } 283 } 284 285 // 286 // allow one saturated slice 287 // 288 if (sat > 0) 289 return; 290 291 Float_t time_sum = 0.; 292 Float_t fmax = 0.; 293 Float_t ftime_max = 0.; 294 Int_t max_p = 0; 295 296 // 288 297 // Calculate the sum of the first fWindowSize slices 289 298 // … … 300 309 { 301 310 const Int_t idx = fBinningResolutionHiGain*sample+fBinningResolutionHalfHiGain; 302 const Float_t pex = fHiGainSignal[sample+i] -pedmean[(sample+i+abflag) & 0x1];311 const Float_t pex = fHiGainSignal[sample+i]; 303 312 sum += fAmpWeightsHiGain [idx]*pex; 304 313 time_sum += fTimeWeightsHiGain[idx]*pex; … … 348 357 { 349 358 const Int_t idx = fBinningResolutionHiGain*sample + fBinningResolutionHalfHiGain + t_iter; 350 const Int_t ids = (IsNoiseCalculation()) ? sample : max_p + sample;359 const Int_t ids = IsNoiseCalculation() ? sample : max_p + sample; 351 360 352 361 const Float_t pex = ids < 0 ? 0. : 353 ( ids > range ? 0. : fHiGainSignal[ids] -pedmean[(ids+abflag) & 0x1]);362 ( ids > range ? 0. : fHiGainSignal[ids]); 354 363 sum += fAmpWeightsHiGain [idx]*pex; 355 364 time_sum += fTimeWeightsHiGain[idx]*pex; … … 376 385 377 386 // 378 // Check for saturation in all other slices 379 // 380 while (p<end) 381 { 382 383 fLoGainSignal[count++] = (Float_t)*p; 384 385 if (*p > max) 386 { 387 max = *p; 388 maxpos = p-ptr; 389 } 390 391 if (*p++ >= fSaturationLimit) 392 sat++; 393 } 394 395 Float_t time_sum = 0.; 396 Float_t fmax = 0.; 397 Float_t ftime_max = 0.; 398 Int_t max_p = 0; 399 387 // Prepare the low-gain pedestal 388 // 400 389 const Float_t pedes = ped.GetPedestal(); 401 390 const Float_t ABoffs = ped.GetPedestalABoffset(); … … 406 395 407 396 // 397 // Check for saturation in all other slices 398 // 399 while (p<end) 400 { 401 402 const Int_t ids = fLoGainFirst + count ; 403 const Float_t signal = (Float_t)*p - pedmean[(ids+abflag) & 0x1]; 404 fLoGainSignal[count] = signal; 405 406 count++; 407 408 if (*p > max) 409 { 410 max = *p; 411 maxpos = p-ptr; 412 } 413 414 if (*p++ >= fSaturationLimit) 415 sat++; 416 } 417 418 Float_t time_sum = 0.; 419 Float_t fmax = 0.; 420 Float_t ftime_max = 0.; 421 Int_t max_p = 0; 422 423 // 408 424 // Calculate the sum of the first fWindowSize slices 409 425 // … … 420 436 { 421 437 const Int_t idx = fBinningResolutionLoGain*sample+fBinningResolutionHalfLoGain; 422 const Float_t pex = fLoGainSignal[sample+i] -pedmean[(sample+i+abflag) & 0x1];438 const Float_t pex = fLoGainSignal[sample+i]; 423 439 sum += fAmpWeightsLoGain [idx]*pex; 424 440 time_sum += fTimeWeightsLoGain[idx]*pex; … … 469 485 const Int_t ids = (IsNoiseCalculation()) ? sample : max_p + sample;; 470 486 const Float_t pex = ids < 0 ? 0. : 471 ( ids > range ? 0. : fLoGainSignal[ids] -pedmean[(ids+abflag) & 0x1]);487 ( ids > range ? 0. : fLoGainSignal[ids]); 472 488 sum += fAmpWeightsLoGain [idx]*pex; 473 489 time_sum += fTimeWeightsLoGain[idx]*pex; -
trunk/MagicSoft/Mars/msignal/MExtractTimeAndChargeSpline.cc
r5293 r5373 353 353 Int_t count = 0; 354 354 355 Float_t pedes= ped.GetPedestal();355 const Float_t pedes = ped.GetPedestal(); 356 356 const Float_t ABoffs = ped.GetPedestalABoffset(); 357 357 358 Float_t PedMean[2];359 PedMean[0] = pedes + ABoffs;360 PedMean[1] = pedes - ABoffs;358 Float_t pedmean[2]; 359 pedmean[0] = pedes + ABoffs; 360 pedmean[1] = pedes - ABoffs; 361 361 362 362 fAbMax = 0.; … … 371 371 372 372 const Int_t ids = fHiGainFirst + count ; 373 const Float_t signal = (Float_t)*p - PedMean[(ids+abflag) & 0x1];373 const Float_t signal = (Float_t)*p - pedmean[(ids+abflag) & 0x1]; 374 374 fHiGainSignal[count] = signal; 375 375 … … 395 395 396 396 const Int_t ids = fHiGainFirst + range ; 397 const Float_t signal = (Float_t)*logain - PedMean[(ids+abflag) & 0x1];397 const Float_t signal = (Float_t)*logain - pedmean[(ids+abflag) & 0x1]; 398 398 fHiGainSignal[range] = signal; 399 399 range++; … … 683 683 // Now integrate the whole thing! 684 684 // 685 Int_t startslice = (Int_t)(fAbMaxPos - fRiseTime);686 Int_t lastslice = (Int_t)(fAbMaxPos + fFallTime);685 Int_t startslice = IsNoiseCalculation() ? 0 : (Int_t)(fAbMaxPos - fRiseTime); 686 Int_t lastslice = IsNoiseCalculation() ? (Int_t)(fRiseTime+fFallTim) : (Int_t)(fAbMaxPos + fFallTime); 687 687 688 688 if (startslice < 0) … … 728 728 const Float_t ABoffs = ped.GetPedestalABoffset(); 729 729 730 Float_t PedMean[2];731 PedMean[0] = pedes + ABoffs;732 PedMean[1] = pedes - ABoffs;730 Float_t pedmean[2]; 731 pedmean[0] = pedes + ABoffs; 732 pedmean[1] = pedes - ABoffs; 733 733 734 734 fAbMax = 0.; … … 743 743 744 744 const Int_t ids = fLoGainFirst + count ; 745 const Float_t signal = (Float_t)*p - PedMean[(ids+abflag) & 0x1];745 const Float_t signal = (Float_t)*p - pedmean[(ids+abflag) & 0x1]; 746 746 fLoGainSignal[count] = signal; 747 747 … … 1034 1034 // Now integrate the whole thing! 1035 1035 // 1036 Int_t startslice = (Int_t)(fAbMaxPos - fRiseTime);1037 Int_t lastslice = (Int_t)(fAbMaxPos + fFallTime + 1);1036 Int_t startslice = IsNoiseCalculation() ? 0 : (Int_t)(fAbMaxPos - fRiseTime); 1037 Int_t lastslice = IsNoiseCalculation() ? (Int_t)(fRiseTime+fFallTim) : (Int_t)(fAbMaxPos + fFallTime + 1); 1038 1038 1039 1039 if (startslice < 0)
Note:
See TracChangeset
for help on using the changeset viewer.