Changeset 5746 for trunk/MagicSoft/Mars
- Timestamp:
- 01/08/05 20:08:03 (20 years ago)
- Location:
- trunk/MagicSoft/Mars
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/Changelog
r5744 r5746 44 44 * msignal/MExtractTimeAndChargeDigitalFilter.cc 45 45 - fixed two bugs introduced yesterday by TB. 46 47 * msignal/MExtractTimeAndChargeSpline.cc 48 * msignal/MExtractTimeAndChargeSlidingWindow.cc 49 - adopt part of TB's speed accelerations into these classes 50 51 * msignal/MExtractTimeAndCharge.cc 52 - fix the low-gain extraction window for the case that the high-gain 53 is saturated. Was skipped so far. 46 54 47 55 -
trunk/MagicSoft/Mars/msignal/MExtractTimeAndCharge.cc
r5734 r5746 86 86 87 87 const Float_t MExtractTimeAndCharge::fgLoGainStartShift = -2.8; 88 89 88 // -------------------------------------------------------------------------- 90 89 // … … 157 156 fLoGainFirst, fLoGainLast, fNumLoGainSamples); 158 157 158 159 159 return kTRUE; 160 160 } … … 166 166 // Calculate the integral of the FADC time slices and store them as a new 167 167 // pixel in the MExtractedSignalCam container. 168 // The functions FindTimeAndChargeHiGain() and FindTimeAndChargeLoGain are168 // The functions FindTimeAndChargeHiGain() and FindTimeAndChargeLoGain() are 169 169 // supposed to extract the signal themselves. 170 170 // 171 171 Int_t MExtractTimeAndCharge::Process() 172 172 { 173 // This cleaning is nor necessary: It is done automatically by174 // Reset() before each execution of the Tasklist (Process())175 // fArrTime->Clear();176 // fSignals->Clear();177 173 178 174 MRawEvtPixelIter pixel(fRawEvt); … … 216 212 217 213 fLoGainFirstSave = fLoGainFirst; 218 const Byte_t logainstart = (Byte_t)(timehi+fLoGainStartShift); 219 if (!sathi) 220 fLoGainFirst = logainstart > fLoGainFirstSave ? logainstart : fLoGainFirstSave; 221 222 if (fLoGainFirst < fLoGainLast) 223 { 214 const Byte_t logainstart = sathi 215 ? sathi + (Int_t)fLoGainStartShift 216 : (Byte_t)(timehi + fLoGainStartShift); 217 fLoGainFirst = logainstart > fLoGainFirstSave ? logainstart : fLoGainFirstSave; 218 219 if ( fLoGainFirst < fLoGainLast ) 220 { 224 221 const Bool_t logainabflag = (higainabflag + pixel.GetNumHiGainSamples()) & 0x1; 225 222 FindTimeAndChargeLoGain(pixel.GetLoGainSamples()+fLoGainFirst, -
trunk/MagicSoft/Mars/msignal/MExtractTimeAndChargeSlidingWindow.cc
r5511 r5746 210 210 211 211 Float_t max = 0; // highest integral content of all windows 212 Int_t count = 0; // counter to recognize the AB-flag 212 Int_t count = 0; 213 sat = 0; 213 214 214 215 const Float_t pedes = ped.GetPedestal(); 215 216 const Float_t ABoffs = ped.GetPedestalABoffset(); 216 217 217 Float_t PedMean[2]; 218 PedMean[0] = pedes + ABoffs; 219 PedMean[1] = pedes - ABoffs; 220 218 Float_t PedMean[2] = { pedes + ABoffs, pedes - ABoffs }; 221 219 // 222 220 // Check for saturation in all other slices 223 221 // 222 Int_t ids = fHiGainFirst; 223 224 224 while (p<first+fWindowSizeHiGain) 225 225 { 226 const Int_t ids = fHiGainFirst + count; 227 const Float_t signal = (Float_t)*p - PedMean[(ids+ abflag) & 0x1];226 227 const Float_t signal = (Float_t)*p - PedMean[(ids++ + abflag) & 0x1]; 228 228 sum += signal; 229 229 fHiGainSignal[count] = signal; 230 230 231 231 if (*p++ >= fSaturationLimit) 232 sat++; 233 232 if (!sat) 233 sat = p-first+fHiGainFirst-1; 234 234 235 count++; 235 236 } … … 240 241 while (p<end) 241 242 if (*p++ >= fSaturationLimit) 242 sat++; 243 if (!sat) 244 sat = p-first+fHiGainFirst-1; 243 245 244 246 if (IsNoiseCalculation()) … … 257 259 { 258 260 259 const Int_t ids = fHiGainFirst + count + fWindowSizeHiGain; 260 const Float_t signal = (Float_t)*(p+fWindowSizeHiGain) - PedMean[(ids+abflag) & 0x1]; 261 const Float_t signal = (Float_t)*(p+fWindowSizeHiGain) - PedMean[(ids++ + abflag) & 0x1]; 261 262 sum += signal - fHiGainSignal[count]; 262 263 fHiGainSignal[count + fWindowSizeHiGain] = signal; … … 281 282 { 282 283 283 const Int_t ids = fHiGainFirst + count + fWindowSizeHiGain; 284 const Float_t signal = (Float_t)*l - PedMean[(ids+abflag) & 0x1]; 284 const Float_t signal = (Float_t)*l - PedMean[(ids++ + abflag) & 0x1]; 285 285 sum += signal - fHiGainSignal[count]; 286 286 fHiGainSignal[count + fWindowSizeHiGain] = signal; 287 count++;288 287 if (*l++ >= fSaturationLimit) 289 sat++; 288 if (!sat) 289 sat = l-logain+fHiGainLast-1; 290 290 291 291 if (sum>max) … … 294 294 idx = count+1; 295 295 } 296 count++; 296 297 p++; 297 298 } 298 299 299 if (fHiLoLast > fWindowSizeHiGain)300 if (fHiLoLast > (Byte_t)fWindowSizeHiGain) 300 301 { 301 302 while (l < logain + fHiLoLast) 302 303 { 303 const Int_t ids = fHiGainFirst + count + fWindowSizeHiGain; 304 const Float_t signal = (Float_t)*l - PedMean[(ids+abflag) & 0x1]; 304 const Float_t signal = (Float_t)*l - PedMean[(ids++ + abflag) & 0x1]; 305 305 sum += signal - fHiGainSignal[count]; 306 306 fHiGainSignal[count+fWindowSizeHiGain] = signal; 307 count++; 308 if (*(l+fWindowSizeHiGain) >= fSaturationLimit) 309 sat++; 310 307 308 if (*l++ >= fSaturationLimit) 309 if (!sat) 310 sat = l-logain+fHiGainLast-1; 311 311 312 if (sum>max) 312 313 { … … 314 315 idx = count+1; 315 316 } 316 l++;317 count++; 317 318 } /* while (l < logain + fHiLoLast) */ 318 319 } /* if (fHiLoLast > fWindowSizeHiGain) */ … … 333 334 sum = max; 334 335 335 time = sum != 0? timesignalsum / max + Float_t(fHiGainFirst) : 1.;336 dtime = sum != 0? ped.GetPedestalRms() / max * sqrt(timesquaredsum - fWindowSizeHiGain*time) : 1.;336 time = max > 0.1 ? timesignalsum / max + Float_t(fHiGainFirst) : 1.; 337 dtime = max > 0.1 ? ped.GetPedestalRms() / max * sqrt(timesquaredsum - fWindowSizeHiGain*time) : 1.; 337 338 338 339 } … … 358 359 const Float_t ABoffs = ped.GetPedestalABoffset(); 359 360 360 Float_t PedMean[2]; 361 PedMean[0] = pedes + ABoffs; 362 PedMean[1] = pedes - ABoffs; 363 361 Float_t PedMean[2] = { pedes + ABoffs, pedes - ABoffs }; 364 362 // 365 363 // Check for saturation in all other slices 366 364 // 365 Int_t ids = fLoGainFirst; 366 367 367 while (p<first+fWindowSizeLoGain) 368 368 { 369 const Int_t ids = fLoGainFirst + count; 370 const Float_t signal = (Float_t)*p - PedMean[(ids+abflag) & 0x1]; 369 const Float_t signal = (Float_t)*p - PedMean[(ids++ + abflag) & 0x1]; 371 370 sum += signal; 372 371 fLoGainSignal[count] = signal; … … 400 399 { 401 400 402 const Int_t ids = fLoGainFirst + count + fWindowSizeLoGain; 403 const Float_t signal = (Float_t)*(p+fWindowSizeLoGain) - PedMean[(ids+abflag) & 0x1]; 401 const Float_t signal = (Float_t)*(p+fWindowSizeLoGain) - PedMean[(ids++ + abflag) & 0x1]; 404 402 sum += signal - fLoGainSignal[count]; 405 403 fLoGainSignal[count + fWindowSizeLoGain] = signal; … … 427 425 sum = max; 428 426 429 time = sum != 0? timesignalsum / max + Float_t(fLoGainFirst) : 1.;430 dtime = sum != 0? ped.GetPedestalRms() / max * sqrt(timesquaredsum - fWindowSizeLoGain*time) : 1.;427 time = max > 0.1 ? timesignalsum / max + Float_t(fLoGainFirst) : 1.; 428 dtime = max > 0.1 ? ped.GetPedestalRms() / max * sqrt(timesquaredsum - fWindowSizeLoGain*time) : 1.; 431 429 } 432 430
Note:
See TracChangeset
for help on using the changeset viewer.