Changeset 5790
- Timestamp:
- 01/10/05 20:12:58 (20 years ago)
- Location:
- trunk/MagicSoft/Mars
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/Changelog
r5780 r5790 47 47 lead to an unsuitable pixel. 48 48 49 * msignal/MExtractTimeAndChargeDigitalFilter.[h,cc] 50 - implemented changes suggested by T.B. to speed up calculations 49 51 50 52 -
trunk/MagicSoft/Mars/msignal/MExtractTimeAndChargeDigitalFilter.cc
r5747 r5790 212 212 } 213 213 214 void MExtractTimeAndChargeDigitalFilter::CalcBinningResArrays() 215 { 216 217 fArrBinningResHiGain.Set(fWindowSizeHiGain); 218 fArrBinningResHalfHiGain.Set(fWindowSizeHiGain); 219 220 for (int i=0; i<fWindowSizeHiGain; i++) 221 { 222 fArrBinningResHiGain[i] = fBinningResolutionHiGain*i; 223 fArrBinningResHalfHiGain[i] = fArrBinningResHiGain[i] + fBinningResolutionHalfHiGain; 224 } 225 226 fArrBinningResLoGain.Set(fWindowSizeLoGain); 227 fArrBinningResHalfLoGain.Set(fWindowSizeLoGain); 228 229 for (int i=0; i<fWindowSizeLoGain; i++) 230 { 231 fArrBinningResLoGain[i] = fBinningResolutionLoGain*i; 232 fArrBinningResHalfLoGain[i] = fArrBinningResLoGain[i] + fBinningResolutionHalfLoGain; 233 } 234 } 235 214 236 // -------------------------------------------------------------------------- 215 237 // … … 253 275 if (*p++ >= fSaturationLimit) 254 276 if (!sat) 255 sat = ids- 3;277 sat = ids-4; 256 278 } 257 279 … … 274 296 if (*logain++ >= fSaturationLimit) 275 297 if (!sat) 276 sat = ids- 3;298 sat = ids-4; 277 299 278 300 range++; … … 296 318 for (Int_t ids=0; ids < fWindowSizeHiGain; ids++) 297 319 { 298 const Int_t idx = f BinningResolutionHiGain*ids+ fRandomIter;320 const Int_t idx = fArrBinningResHiGain[ids] + fRandomIter; 299 321 sum += fAmpWeightsHiGain [idx]*fHiGainSignal[ids]; 300 322 } … … 322 344 for (Int_t sample=0; sample < fWindowSizeHiGain; sample++) 323 345 { 324 const Int_t idx = f BinningResolutionHiGain*sample+fBinningResolutionHalfHiGain;346 const Int_t idx = fArrBinningResHalfHiGain[sample]; 325 347 const Float_t pex = fHiGainSignal[sample+i]; 326 348 sum += fAmpWeightsHiGain [idx]*pex; … … 368 390 for (Int_t sample=0; sample < fWindowSizeHiGain; sample++) 369 391 { 370 const Int_t idx = f BinningResolutionHiGain*sample + fBinningResolutionHalfHiGain+ t_iter;392 const Int_t idx = fArrBinningResHalfHiGain[sample] + t_iter; 371 393 const Int_t ids = max_p + sample; 372 394 const Float_t pex = ids < 0 ? 0. : ( ids >= range ? 0. : fHiGainSignal[ids]); … … 435 457 for (Int_t ids=0; ids < fWindowSizeLoGain; ids++) 436 458 { 437 const Int_t idx = f BinningResolutionLoGain*ids+ fRandomIter;459 const Int_t idx = fArrBinningResLoGain[ids] + fRandomIter; 438 460 sum += fAmpWeightsLoGain [idx]*fLoGainSignal[ids]; 439 461 } … … 460 482 for (Int_t sample=0; sample < fWindowSizeLoGain; sample++) 461 483 { 462 const Int_t idx = f BinningResolutionLoGain*sample+fBinningResolutionHalfLoGain;484 const Int_t idx = fArrBinningResHalfLoGain[sample]; 463 485 const Float_t pex = fLoGainSignal[sample+i]; 464 486 sum += fAmpWeightsLoGain [idx]*pex; … … 507 529 for (Int_t sample=0; sample < fWindowSizeLoGain; sample++) 508 530 { 509 const Int_t idx = f BinningResolutionLoGain*sample + fBinningResolutionHalfLoGain+ t_iter;531 const Int_t idx = fArrBinningResHalfLoGain[sample] + t_iter; 510 532 const Int_t ids = max_p + sample; 511 533 const Float_t pex = ids < 0 ? 0. : ( ids >= range ? 0. : fLoGainSignal[ids]); … … 674 696 } 675 697 676 len = fBinningResolutionLoGain*fWindowSize HiGain;698 len = fBinningResolutionLoGain*fWindowSizeLoGain; 677 699 fAmpWeightsLoGain .Set(len); 678 700 fTimeWeightsLoGain.Set(len); … … 724 746 *fLog << inf << " File contains " << fWindowSizeLoGain << " lo-gain slices "; 725 747 *fLog << "with a resolution of " << fBinningResolutionLoGain << endl; 748 749 CalcBinningResArrays(); 726 750 727 751 fWeightsSet = kTRUE; -
trunk/MagicSoft/Mars/msignal/MExtractTimeAndChargeDigitalFilter.h
r5744 r5790 8 8 #ifndef MARS_MArrayF 9 9 #include "MArrayF.h" 10 #endif 11 12 #ifndef MARS_MArrayI 13 #include "MArrayI.h" 10 14 #endif 11 15 … … 32 36 MArrayF fLoGainSignal; //! Store them in separate arrays 33 37 38 MArrayI fArrBinningResHiGain; //! helping arrays to hold binningres * i 39 MArrayI fArrBinningResLoGain; //! helping arrays to hold binningres * i 40 MArrayI fArrBinningResHalfHiGain; //! helping arrays to hold binningres * i + binningreshalf 41 MArrayI fArrBinningResHalfLoGain; //! helping arrays to hold binningres * i + binningreshalf 42 34 43 Float_t fTimeShiftHiGain; // Time shift from when on to apply the filter 35 44 Float_t fTimeShiftLoGain; // Time shift from when on to apply the filter … … 54 63 Bool_t InitArrays(); 55 64 65 void CalcBinningResArrays(); 66 56 67 Int_t ReadEnv(const TEnv &env, TString prefix, Bool_t print); 57 68
Note:
See TracChangeset
for help on using the changeset viewer.