Changeset 6140 for trunk/MagicSoft
- Timestamp:
- 01/31/05 11:06:21 (20 years ago)
- Location:
- trunk/MagicSoft/Mars/msignal
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/msignal/MExtractTimeAndChargeDigitalFilterPeakSearch.cc
r6138 r6140 78 78 79 79 const Byte_t MExtractTimeAndChargeDigitalFilterPeakSearch::fgHiGainFirst = 0; 80 const Byte_t MExtractTimeAndChargeDigitalFilterPeakSearch::fgHiGainLast = 18;80 const Byte_t MExtractTimeAndChargeDigitalFilterPeakSearch::fgHiGainLast = 20; 81 81 const Byte_t MExtractTimeAndChargeDigitalFilterPeakSearch::fgLoGainFirst = 3; 82 82 const Byte_t MExtractTimeAndChargeDigitalFilterPeakSearch::fgLoGainLast = 14; 83 const Byte_t MExtractTimeAndChargeDigitalFilterPeakSearch::fgOffsetLeftFromPeak = 1; 84 const Byte_t MExtractTimeAndChargeDigitalFilterPeakSearch::fgOffsetRightFromPeak = 2; 85 const Byte_t MExtractTimeAndChargeDigitalFilterPeakSearch::fgPeakSearchWindowSize = 2; 83 const Byte_t MExtractTimeAndChargeDigitalFilterPeakSearch::fgOffsetLeftFromPeak = 2; 84 const Byte_t MExtractTimeAndChargeDigitalFilterPeakSearch::fgOffsetRightFromPeak = 3; 85 const Byte_t MExtractTimeAndChargeDigitalFilterPeakSearch::fgPeakSearchWindowSize = 2; 86 const Int_t MExtractTimeAndChargeDigitalFilterPeakSearch::fgHiGainFailureLimit = 5; 87 const Int_t MExtractTimeAndChargeDigitalFilterPeakSearch::fgLoGainFailureLimit = 10; 86 88 // -------------------------------------------------------------------------- 87 89 // … … 89 91 // 90 92 // Sets: 91 // - fOffsetLeftFromPeak to fgOffsetLeftFromPeak 92 // - fOffsetRightFromPeak to fgOffsetRightFromPeak 93 // - fOffsetLeftFromPeak to fgOffsetLeftFromPeak 94 // - fOffsetRightFromPeak to fgOffsetRightFromPeak 95 // - fPeakSearchWindowSize to fgPeakSearchWindowSize 96 // - fHiGainFailureLimit to fgHiGainFailureLimit 97 // - fLoGainFailureLimit to fgLoGainFailureLimit 93 98 // 94 99 MExtractTimeAndChargeDigitalFilterPeakSearch::MExtractTimeAndChargeDigitalFilterPeakSearch(const char *name, const char *title) … … 100 105 SetOffsetRightFromPeak(); 101 106 SetPeakSearchWindowSize(); 107 SetHiGainFailureLimit(); 108 SetLoGainFailureLimit(); 109 } 110 111 // -------------------------------------------------------------------------- 112 // 113 // The PreProcess searches for the following input containers: 114 // - MRawEvtData 115 // - MRawRunHeader 116 // - MPedestalCam 117 // 118 // The following output containers are also searched and created if 119 // they were not found: 120 // 121 // - MExtractedSignalCam 122 // - MArrivalTimeCam 123 // 124 // The following variables are set to 0: 125 // 126 // - fHiGainOutOfRangeLeft 127 // - fHiGainOutOfRangeRight 128 // - fLoGainOutOfRangeLeft 129 // - fLoGainOutOfRangeRight 130 // 131 Int_t MExtractTimeAndChargeDigitalFilterPeakSearch::PreProcess(MParList *pList) 132 { 133 134 if (!MExtractTimeAndCharge::PreProcess(pList)) 135 return kFALSE; 136 137 fHiGainOutOfRangeLeft = 0; 138 fHiGainOutOfRangeRight = 0; 139 fLoGainOutOfRangeLeft = 0; 140 fLoGainOutOfRangeRight = 0; 141 142 return kTRUE; 102 143 } 103 144 … … 233 274 fHiGainFirst = higainfirst - fOffsetLeftFromPeak; 234 275 else 235 *fLog << warn << " High Gain ranges out of limits to the left!!! " << (Int_t)higainfirst << endl;276 fHiGainOutOfRangeLeft++; 236 277 237 278 // … … 241 282 fHiGainLast = higainfirst + fOffsetRightFromPeak + fWindowSizeHiGain; 242 283 else 243 *fLog << warn << " High Gain ranges out of limits to the right!!! " << (Int_t)higainfirst << endl;284 fHiGainOutOfRangeRight++; 244 285 245 286 … … 247 288 fLoGainFirst = fHiGainFirst + (Int_t)fOffsetLoGain; 248 289 else 249 *fLog << inf << " High Gain ranges out of limits to the left!!! " << (Int_t)fHiGainFirst << endl;290 fLoGainOutOfRangeLeft++; 250 291 251 292 // … … 255 296 fLoGainLast = fLoGainFirst+fWindowSizeLoGain+fOffsetRightFromPeak; 256 297 else 257 *fLog << warn << " Low Gain ranges out of limits to the right!!! " << endl;298 fLoGainOutOfRangeRight++; 258 299 259 300 pixel.Reset(); … … 347 388 } 348 389 349 390 Int_t MExtractTimeAndChargeDigitalFilterPeakSearch::PostProcess() 391 { 392 393 if (GetNumExecutions() == 0) 394 return kTRUE; 395 396 const Int_t higainfailure = (fHiGainOutOfRangeLeft+fHiGainOutOfRangeRight)/GetNumExecutions()*100; 397 const Int_t logainfailure = (fLoGainOutOfRangeLeft+fLoGainOutOfRangeRight)/GetNumExecutions()*100; 398 399 if (fHiGainOutOfRangeLeft > 0) 400 *fLog << warn << GetDescriptor() << ": " << fHiGainOutOfRangeLeft/GetNumExecutions()*100 << "% ranging out of high-gain window to the left!" << endl; 401 if (fHiGainOutOfRangeRight > 0) 402 *fLog << warn << GetDescriptor() << ": " << fHiGainOutOfRangeRight/GetNumExecutions()*100 << "% ranging out of high-gain window to the right!" << endl; 403 if (fLoGainOutOfRangeLeft > 0) 404 *fLog << warn << GetDescriptor() << ": " << fLoGainOutOfRangeLeft/GetNumExecutions()*100 << "% ranging out of low-gain window to the left!" << endl; 405 if (fHiGainOutOfRangeRight > 0) 406 *fLog << warn << GetDescriptor() << ": " << fHiGainOutOfRangeRight/GetNumExecutions()*100 << "% ranging out of high-gain window to the right!" << endl; 407 408 409 if (higainfailure > fHiGainFailureLimit) 410 { 411 *fLog << err << GetDescriptor() << ": " << higainfailure << "% range failures in high gain above limit of: " << fHiGainFailureLimit << "%." << endl; 412 return kFALSE; 413 } 414 415 if (logainfailure > fLoGainFailureLimit) 416 { 417 *fLog << err << GetDescriptor() << ": " << logainfailure << "% range failures in low gain above limit of: " << fLoGainFailureLimit << "%." << endl; 418 return kFALSE; 419 } 420 421 422 423 return kTRUE; 424 425 } 350 426 351 427 // -------------------------------------------------------------------------- … … 381 457 } 382 458 459 if (IsEnvDefined(env, prefix, "HiGainFailureLimit", print)) 460 { 461 fHiGainFailureLimit = GetEnvValue(env, prefix, fHiGainFailureLimit); 462 rc = kTRUE; 463 } 464 465 if (IsEnvDefined(env, prefix, "LoGainFailureLimit", print)) 466 { 467 fLoGainFailureLimit = GetEnvValue(env, prefix, fLoGainFailureLimit); 468 rc = kTRUE; 469 } 470 383 471 return MExtractTimeAndChargeDigitalFilter::ReadEnv(env, prefix, print) ? kTRUE : rc; 384 472 } … … 394 482 *fLog << " Offset from Peak right: " << fOffsetRightFromPeak << endl; 395 483 *fLog << " Peak search window size: " << fPeakSearchWindowSize << endl; 396 } 484 *fLog << " High Gain Failure limit: " << fHiGainFailureLimit << endl; 485 *fLog << " Low Gain Failure limit: " << fLoGainFailureLimit << endl; 486 } -
trunk/MagicSoft/Mars/msignal/MExtractTimeAndChargeDigitalFilterPeakSearch.h
r6117 r6140 21 21 private: 22 22 23 static const Byte_t fgHiGainFirst; //! Default for fHiGainFirst (now set to: 0) 24 static const Byte_t fgHiGainLast; //! Default for fHiGainLast (now set to:18) 25 static const Byte_t fgLoGainFirst; //! Default for fLoGainFirst (now set to: 2) 26 static const Byte_t fgLoGainLast; //! Default for fLoGainLast (now set to:14) 27 static const Byte_t fgOffsetLeftFromPeak; //! Default for fOffsetLeftFromPeak (now set to: 1) 28 static const Byte_t fgOffsetRightFromPeak; //! Default for fOffsetRightFromPeak (now set to: 2) 29 static const Byte_t fgPeakSearchWindowSize; //! Default for fPeakSearchWindowSize (now set to: 2) 23 static const Byte_t fgHiGainFirst; //! Default for fHiGainFirst (now set to: 0) 24 static const Byte_t fgHiGainLast; //! Default for fHiGainLast (now set to:18) 25 static const Byte_t fgLoGainFirst; //! Default for fLoGainFirst (now set to: 2) 26 static const Byte_t fgLoGainLast; //! Default for fLoGainLast (now set to:14) 27 static const Byte_t fgOffsetLeftFromPeak; //! Default for fOffsetLeftFromPeak (now set to: 1) 28 static const Byte_t fgOffsetRightFromPeak; //! Default for fOffsetRightFromPeak (now set to: 2) 29 static const Byte_t fgPeakSearchWindowSize; //! Default for fPeakSearchWindowSize (now set to: 2) 30 static const Int_t fgHiGainFailureLimit; //! Default for fHiGainMaxFailureLimit (now set to: 5) 31 static const Int_t fgLoGainFailureLimit; //! Default for fHiGainMaxFailureLimit (now set to: 10) 30 32 31 33 Byte_t fOffsetLeftFromPeak; // Number of slices to start extraction before peak slice 32 34 Byte_t fOffsetRightFromPeak; // Number of slices to stop extraction after peak slice 33 35 Byte_t fPeakSearchWindowSize; // Size of FADC window in the search for the highest peak of all pixels. 36 Int_t fHiGainFailureLimit; // Limit for percentage of events ranging out of limits in high gain 37 Int_t fLoGainFailureLimit; // Limit for percentage of events ranging out of limits in low gain 38 39 ULong_t fHiGainOutOfRangeLeft; // Number of events out of range to the left side in high gain 40 ULong_t fHiGainOutOfRangeRight; // Number of events out of range to the right side in high gain 41 ULong_t fLoGainOutOfRangeLeft; // Number of events out of range to the left side in low gain 42 ULong_t fLoGainOutOfRangeRight; // Number of events out of range to the right side in low gain 34 43 35 44 void FindPeak(Byte_t *ptr, Byte_t &startslice, Int_t &signal, Int_t &sat, Byte_t &satpos) const; 36 45 46 Int_t PreProcess(MParList *pList); 47 Int_t Process(); 48 Int_t PostProcess(); 49 37 50 Int_t ReadEnv(const TEnv &env, TString prefix, Bool_t print); 38 Int_t Process();39 51 40 52 public: … … 43 55 ~MExtractTimeAndChargeDigitalFilterPeakSearch() { } 44 56 45 void SetOffsetLeftFromPeak ( Byte_t offset=fgOffsetLeftFromPeak ) { fOffsetLeftFromPeak = offset; } 46 void SetOffsetRightFromPeak( Byte_t offset=fgOffsetRightFromPeak ) { fOffsetRightFromPeak = offset; } 47 void SetPeakSearchWindowSize(Byte_t size =fgPeakSearchWindowSize ) { fPeakSearchWindowSize = size; } 57 void SetOffsetLeftFromPeak ( Byte_t offset=fgOffsetLeftFromPeak ) { fOffsetLeftFromPeak = offset; } 58 void SetOffsetRightFromPeak( Byte_t offset=fgOffsetRightFromPeak ) { fOffsetRightFromPeak = offset; } 59 void SetPeakSearchWindowSize(Byte_t size =fgPeakSearchWindowSize ) { fPeakSearchWindowSize = size; } 60 void SetHiGainFailureLimit ( Int_t lim=fgHiGainFailureLimit ) { fHiGainFailureLimit = lim; } 61 void SetLoGainFailureLimit ( Int_t lim=fgLoGainFailureLimit ) { fLoGainFailureLimit = lim; } 48 62 49 63 void Print(Option_t *o="") const;
Note:
See TracChangeset
for help on using the changeset viewer.