Changeset 3925 for trunk/MagicSoft/Mars/msignal
- Timestamp:
- 05/01/04 12:34:15 (21 years ago)
- Location:
- trunk/MagicSoft/Mars/msignal
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/msignal/MExtractFixedWindowPeakSearch.cc
r3887 r3925 16 16 ! 17 17 ! 18 ! Author(s): Abelardo Moralejo, 19 ! Markus Gaug , 18 ! Author(s): Abelardo Moralejo,04/2004 <mailto:moralejo@pd.infn.it> 19 ! Markus Gaug ,04/2004 <mailto:markus@ifae.es> 20 20 ! Copyright: MAGIC Software Development, 2000-2004 21 21 ! … … 75 75 using namespace std; 76 76 77 const Byte_t MExtractFixedWindowPeakSearch::fgHiGainWindowSize = 6;78 const Byte_t MExtractFixedWindowPeakSearch::fgLoGainWindowSize = 6;79 const Byte_t MExtractFixedWindowPeakSearch::fgPeakSearchWindowSize = 4;80 77 const Byte_t MExtractFixedWindowPeakSearch::fgHiGainFirst = 0; 81 78 const Byte_t MExtractFixedWindowPeakSearch::fgHiGainLast = 14; 82 79 const Byte_t MExtractFixedWindowPeakSearch::fgLoGainFirst = 3; 83 80 const Byte_t MExtractFixedWindowPeakSearch::fgLoGainLast = 14; 81 const Byte_t MExtractFixedWindowPeakSearch::fgHiGainWindowSize = 6; 82 const Byte_t MExtractFixedWindowPeakSearch::fgLoGainWindowSize = 6; 83 const Byte_t MExtractFixedWindowPeakSearch::fgPeakSearchWindowSize = 4; 84 const Byte_t MExtractFixedWindowPeakSearch::fgOffsetFromPeak = 2; 84 85 // -------------------------------------------------------------------------- 85 86 // … … 92 93 // 93 94 // Calls: 95 // - SetOffsetFromPeak() 94 96 // - SetRange(fgHiGainFirst, fgHiGainLast, fgLoGainFirst, fgLoGainLast) 95 97 // … … 103 105 fTitle = title ? title : "Task to extract the signal from the FADC slices"; 104 106 107 SetOffsetFromPeak(); 105 108 SetRange(fgHiGainFirst, fgHiGainLast, fgLoGainFirst, fgLoGainLast); 106 109 } … … 171 174 } 172 175 176 173 177 if (fWindowSizeLoGain > availlorange) 174 178 { … … 200 204 } 201 205 202 203 206 fNumHiGainSamples = (Float_t)fWindowSizeHiGain; 204 207 fNumLoGainSamples = (Float_t)fWindowSizeLoGain; … … 271 274 // - If *ptr is greater than fSaturationLimit, raise sat by 1 272 275 // 273 void MExtractFixedWindowPeakSearch::FindSignalHiGain(Byte_t *ptr, Int_t &sum, Byte_t &sat) const 274 { 276 void MExtractFixedWindowPeakSearch::FindSignalHiGain(Byte_t *ptr, Byte_t *logain, Int_t &sum, Byte_t &sat) const 277 { 278 279 Byte_t *end = ptr + fWindowSizeHiGain-fHiLoLast; 280 275 281 // 276 282 // Calculate the sum of the "window" slices starting in ptr 277 283 // 278 sum = 0; 279 sat = 0; 280 Byte_t *p = ptr; 281 282 while (p<ptr+fWindowSizeHiGain) 283 { 284 while (ptr<end) 285 { 286 sum += *ptr; 287 if (*ptr++ >= fSaturationLimit) 288 sat++; 289 } 290 291 // 292 // If part of the "low-Gain" slices are used, 293 // repeat steps one and two for the logain part until fHiLoLast 294 // 295 Byte_t *p = logain; 296 end = logain + fHiLoLast; 297 while (p<end) 298 { 299 284 300 sum += *p; 285 301 if (*p++ >= fSaturationLimit) 286 302 sat++; 287 303 } 288 304 … … 323 339 // "startslice" will mark the slice at which the highest sum begins for that pixel. 324 340 // Then define the beginning of the integration window for ALL pixels as the slice 325 // before that: startslice- 1 (this is somehow arbitrary), unless of course startslice=0,341 // before that: startslice-fOffsetFraomPeak, unless of course startslice-fOffsetFromPeak<=0, 326 342 // in which case we start at 0. We will also check that the integration window does not 327 343 // go beyond the FADC limits. … … 348 364 { 349 365 maxsumhi = sumhi; 350 if ( startslice> 0)351 hiGainFirst = fHiGainFirst + startslice - 1;366 if ((startslice-fOffsetFromPeak) > 0) 367 hiGainFirst = fHiGainFirst + startslice - fOffsetFromPeak; 352 368 else 353 369 hiGainFirst = fHiGainFirst; … … 360 376 // Make sure we will not integrate beyond the hi gain limit: 361 377 if (hiGainFirst+fWindowSizeHiGain > pixel.GetNumHiGainSamples()) 362 hiGainFirst = pixel.GetNumHiGainSamples()-fWindowSizeHiGain; 378 fHiLoLast = hiGainFirst+fWindowSizeHiGain - pixel.GetNumHiGainSamples(); 379 // hiGainFirst = pixel.GetNumHiGainSamples()-fWindowSizeHiGain; 363 380 364 381 // Make sure we will not integrate beyond the lo gain limit: … … 375 392 // Find signal in hi- and lo-gain 376 393 // 377 Int_t sumhi ;378 Byte_t sathi ;379 380 FindSignalHiGain(pixel.GetHiGainSamples()+hiGainFirst, sumhi, sathi);394 Int_t sumhi=0; 395 Byte_t sathi=0; 396 397 FindSignalHiGain(pixel.GetHiGainSamples()+hiGainFirst, pixel.GetLoGainSamples(), sumhi, sathi); 381 398 382 399 Int_t sumlo=0; -
trunk/MagicSoft/Mars/msignal/MExtractFixedWindowPeakSearch.h
r3887 r3925 14 14 static const Byte_t fgLoGainFirst; 15 15 static const Byte_t fgLoGainLast; 16 static const Byte_t fgHiGainWindowSize; // The extraction window Hi-Gain 17 static const Byte_t fgLoGainWindowSize; // The extraction window Lo-Gain 18 static const Byte_t fgPeakSearchWindowSize; // The window in which the global peak is searched for 19 16 static const Byte_t fgHiGainWindowSize; // Default for fWindowSizeHiGain (now set to: 6) 17 static const Byte_t fgLoGainWindowSize; // Default for fWindowSizeLoGain (now set to: 6) 18 static const Byte_t fgPeakSearchWindowSize; // Default for fPeakSearchWindowSize (now set to: 4) 19 static const Byte_t fgOffsetFromPeak; // Default for fOffsetFromPeak (now set to: 2) 20 20 21 Byte_t fWindowSizeHiGain; // Number of Hi Gain slices in window 21 22 Byte_t fWindowSizeLoGain; // Number of Lo Gain slices in window 22 23 Byte_t fPeakSearchWindowSize; // Size of FADC window in the search for the highest peak of all pixels. 24 Byte_t fOffsetFromPeak; // Number of slices to start extraction from global peak 23 25 24 25 void FindSignalHiGain(Byte_t *ptr, Int_t &sum, Byte_t &sat) const; 26 void FindSignalHiGain(Byte_t *ptr, Byte_t *logain, Int_t &sum, Byte_t &sat) const; 26 27 void FindSignalLoGain(Byte_t *ptr, Int_t &sum, Byte_t &sat) const; 27 28 … … 29 30 30 31 Int_t Process(); 31 32 32 33 public: 33 34 … … 37 38 void SetWindows(Byte_t windowh=fgHiGainWindowSize, Byte_t windowl=fgLoGainWindowSize, 38 39 Byte_t peaksearchwindow=fgPeakSearchWindowSize); 39 40 void SetOffsetFromPeak(Byte_t offset=fgOffsetFromPeak) { fOffsetFromPeak = offset; } 41 40 42 ClassDef(MExtractFixedWindowPeakSearch, 0) // Signal Extractor for fixed size trigger-corrected extraction window 41 43 }; -
trunk/MagicSoft/Mars/msignal/MExtractPINDiode.cc
r3911 r3925 129 129 MExtractor::SetRange(hifirst,hilast,lofirst,lolast); 130 130 131 132 fNumHiGainSamples = (Float_t)(fHiGainLast-fHiGainFirst+1); 133 fNumLoGainSamples = (Float_t)(fLoGainLast-fLoGainFirst+1); 134 135 fSqrtHiGainSamples = TMath::Sqrt(fNumHiGainSamples); 136 fSqrtLoGainSamples = TMath::Sqrt(fNumLoGainSamples); 137 131 138 fNumSamples = fHiGainLast-fHiGainFirst+1+fLoGainLast-fLoGainFirst+1; 132 139 fSqrtSamples = TMath::Sqrt((Float_t)fNumSamples); -
trunk/MagicSoft/Mars/msignal/MExtractSlidingWindow.cc
r3886 r3925 194 194 // - Check if the sum has become bigger and store it in case yes. 195 195 // 196 void MExtractSlidingWindow::FindSignalHiGain(Byte_t *ptr, Int_t &max, Byte_t &sat) const196 void MExtractSlidingWindow::FindSignalHiGain(Byte_t *ptr, Byte_t *logain, Int_t &max, Byte_t &sat) const 197 197 { 198 198 const Byte_t *end = ptr + fHiGainLast - fHiGainFirst + 1; … … 205 205 sat = 0; 206 206 Byte_t *p = ptr; 207 while (p<ptr+fWindowSizeHiGain) 207 208 while (p<ptr+fWindowSizeHiGain-fHiLoLast) 208 209 { 209 210 sum += *p; … … 218 219 if (*p++ >= fSaturationLimit) 219 220 sat++; 221 222 // 223 // If part of the "low-Gain" slices are used, 224 // repeat steps one and two for the logain part until fHiLoLast 225 // 226 Byte_t *l = logain; 227 while (l<logain+fHiLoLast) 228 { 229 sum += *l; 230 if (*l++ >= fSaturationLimit) 231 sat++; 232 } 233 220 234 221 235 // … … 225 239 // 226 240 max=sum; 227 for (p=ptr; p+fWindowSizeHiGain <end; p++)228 { 229 sum += *(p+fWindowSizeHiGain ) - *p;241 for (p=ptr; p+fWindowSizeHiGain-fHiLoLast<end; p++) 242 { 243 sum += *(p+fWindowSizeHiGain-fHiLoLast) - *p; 230 244 if (sum>max) 231 245 max = sum; 232 246 } 247 248 for (l=logain; l<logain+fHiLoLast; l++) 249 { 250 sum += *l - *p++; 251 if (sum>max) 252 max = sum; 253 } 254 233 255 } 234 256
Note:
See TracChangeset
for help on using the changeset viewer.