Changeset 7013 for trunk/MagicSoft/Mars/mcalib
- Timestamp:
- 05/11/05 19:06:48 (20 years ago)
- Location:
- trunk/MagicSoft/Mars/mcalib
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/mcalib/MCalibCalcFromPast.cc
r7005 r7013 334 334 // Read the setup from a TEnv, eg: 335 335 // MCalibCalcFromPast.UpdateWithFFactorMethod: Off, On 336 // MCalibCalcFromPast.NumEventsDump: 500 336 337 // 337 338 Int_t MCalibCalcFromPast::ReadEnv(const TEnv &env, TString prefix, Bool_t print) … … 344 345 } 345 346 347 if (IsEnvDefined(env, prefix, "NumEventsDump", print)) 348 { 349 SetNumEventsDump(GetEnvValue(env, prefix, "NumEventsDump", (Int_t)fNumEventsDump)); 350 rc = kTRUE; 351 } 352 346 353 return rc; 347 354 } -
trunk/MagicSoft/Mars/mcalib/MCalibrationChargeCalc.cc
r6928 r7013 231 231 using namespace std; 232 232 233 const Float_t MCalibrationChargeCalc::fgChargeLimit = 2.5;233 const Float_t MCalibrationChargeCalc::fgChargeLimit = 4.5; 234 234 const Float_t MCalibrationChargeCalc::fgChargeErrLimit = 0.; 235 235 const Float_t MCalibrationChargeCalc::fgChargeRelErrLimit = 1.; … … 238 238 const Float_t MCalibrationChargeCalc::fgPheErrLimit = 4.5; 239 239 const Float_t MCalibrationChargeCalc::fgFFactorErrLimit = 4.5; 240 const Float_t MCalibrationChargeCalc::fgArrTimeRmsLimit = 3.5; 240 241 const TString MCalibrationChargeCalc::fgNamePedestalCam = "MPedestalCam"; 242 241 243 // -------------------------------------------------------------------------- 242 244 // … … 252 254 // 253 255 // Initializes: 256 // - fArrTimeRmsLimit to fgArrTimeRmsLimit 254 257 // - fChargeLimit to fgChargeLimit 255 258 // - fChargeErrLimit to fgChargeErrLimit … … 282 285 AddToBranchList("MRawEvtData.fLoGainFadcSamples"); 283 286 287 SetArrTimeRmsLimit (); 284 288 SetChargeLimit (); 285 289 SetChargeErrLimit (); … … 294 298 SetDebug ( kFALSE ); 295 299 300 SetCheckArrivalTimes (); 296 301 SetCheckDeadPixels (); 297 302 SetCheckDeviatingBehavior(); … … 732 737 if (FinalizeCharges(pix,bad,"pixel ")) 733 738 nvalid++; 739 740 FinalizeArrivalTimes(pix,bad,"pixel "); 734 741 } 735 742 … … 760 767 FinalizePedestals(ped,pix,aidx); 761 768 FinalizeCharges(pix, chargecam->GetAverageBadArea(aidx),"area id"); 769 FinalizeArrivalTimes(pix, chargecam->GetAverageBadArea(aidx), "area id"); 762 770 } 763 771 … … 855 863 PrintUncalibrated(MBadPixelsPix::kLoGainOverFlow, 856 864 "Pixels with Low Gain Overflow : "); 865 PrintUncalibrated(MBadPixelsPix::kFluctuatingArrivalTimes, 866 "Fluctuating Pulse Arrival Times: "); 867 PrintUncalibrated(MBadPixelsPix::kDeadPedestalRms, 868 "Presumably dead from Pedestal Rms: "); 869 PrintUncalibrated(MBadPixelsPix::kPreviouslyExcluded, 870 "Previously excluded: "); 857 871 858 872 *fLog << inf << endl; … … 1018 1032 } 1019 1033 1020 1034 // ----------------------------------------------------------------------------------- 1035 // 1036 // Test the arrival Times RMS of the pixel and set the bit 1037 // - MBadPixelsPix::kFluctuatingArrivalTimes 1038 // 1039 void MCalibrationChargeCalc::FinalizeArrivalTimes(MCalibrationChargePix &cal, MBadPixelsPix &bad, const char* what) 1040 { 1041 if (bad.IsUnsuitable(MBadPixelsPix::kUnsuitableRun)) 1042 return; 1043 1044 if (cal.GetAbsTimeRms() > fArrTimeRmsLimit) 1045 { 1046 *fLog << warn; 1047 *fLog << "RMS of pulse arrival times: " << Form("%2.1f", cal.GetAbsTimeRms()); 1048 *fLog << " FADC sl. < " << Form("%2.1", fArrTimeRmsLimit); 1049 *fLog << " in " << what << Form("%3i", cal.GetPixId()) << endl; 1050 bad.SetUncalibrated( MBadPixelsPix::kFluctuatingArrivalTimes); 1051 } 1052 } 1021 1053 1022 1054 // ----------------------------------------------------------------------------------- … … 1039 1071 { 1040 1072 1041 MBadPixelsCam *badcam = fIntensBad 1042 ? (MBadPixelsCam*) fIntensBad->GetCam() : fBadPixels; 1043 MCalibrationChargeCam *chargecam = fIntensCam 1044 ? (MCalibrationChargeCam*)fIntensCam->GetCam() : fCam; 1073 MBadPixelsCam *badcam = fIntensBad ? (MBadPixelsCam*)fIntensBad->GetCam() : fBadPixels; 1045 1074 1046 1075 for (Int_t i=0; i<badcam->GetSize(); i++) 1047 1076 { 1048 1077 1049 MBadPixelsPix &bad = (*badcam) [i]; 1050 MCalibrationPix &pix = (*chargecam)[i]; 1078 MBadPixelsPix &bad = (*badcam)[i]; 1051 1079 1052 1080 if (IsCheckDeadPixels()) … … 1086 1114 } 1087 1115 1088 if (bad.IsUnsuitable( MBadPixelsPix::kUnsuitableRun )) 1089 pix.SetExcluded(); 1116 if (IsCheckArrivalTimes()) 1117 { 1118 if (bad.IsUncalibrated( MBadPixelsPix::kFluctuatingArrivalTimes )) 1119 bad.SetUnsuitable( MBadPixelsPix::kUnsuitableRun ); 1120 } 1090 1121 1091 1122 if (bad.IsUncalibrated( MBadPixelsPix::kChargeSigmaNotValid )) … … 1812 1843 qepix.SetFFactorMethodValid(kFALSE,fPulserColor); 1813 1844 pix.SetFFactorMethodValid(kFALSE); 1814 pix.SetExcluded();1815 1845 continue; 1816 1846 } … … 2200 2230 rc = kTRUE; 2201 2231 } 2232 if (IsEnvDefined(env, prefix, "ArrTimeRmsLimit", print)) 2233 { 2234 SetArrTimeRmsLimit(GetEnvValue(env, prefix, "ArrTimeRmsLimit", fArrTimeRmsLimit)); 2235 rc = kTRUE; 2236 } 2202 2237 if (IsEnvDefined(env, prefix, "FFactorErrLimit", print)) 2203 2238 { … … 2245 2280 rc = kTRUE; 2246 2281 } 2247 2282 if (IsEnvDefined(env, prefix, "CheckArrivalTimes", print)) 2283 { 2284 SetCheckArrivalTimes(GetEnvValue(env, prefix, "CheckArrivalTimes", IsCheckArrivalTimes())); 2285 rc = kTRUE; 2286 } 2287 2248 2288 return rc; 2249 2289 } -
trunk/MagicSoft/Mars/mcalib/MCalibrationChargeCalc.h
r6153 r7013 56 56 static const Float_t fgPheErrLimit; //! Default for fPheErrLimit (now set to: 4.5) 57 57 static const Float_t fgFFactorErrLimit; //! Default for fFFactorErrLimit (now set to: 4.5) 58 static const Float_t fgArrTimeRmsLimit; //! Default for fArrTimeRmsLimit (now set to: 3.5) 58 59 59 60 static const TString fgNamePedestalCam; //! "MPedestalCam" … … 69 70 Float_t fPheErrLimit; // Limit acceptance nr. phe's w.r.t. area idx mean (in sigmas) 70 71 Float_t fFFactorErrLimit; // Limit acceptance F-Factor w.r.t. area idx mean 72 Float_t fArrTimeRmsLimit; // Limit acceptance RMS of absolute arrival times 71 73 Float_t fSqrtHiGainSamples; // Square root nr. High-Gain FADC slices used by extractor 72 74 Float_t fSqrtLoGainSamples; // Square root nr. Low -Gain FADC slices used by extractor … … 112 114 kCheckHistOverflow, 113 115 kCheckDeviatingBehavior, 114 kCheckOscillations 116 kCheckOscillations, 117 kCheckArrivalTimes 115 118 }; // Possible Checks 116 119 … … 122 125 // functions 123 126 void FinalizePedestals ( const MPedestalPix &ped, MCalibrationChargePix &cal, const Int_t aidx ); 127 void FinalizeArrivalTimes ( MCalibrationChargePix &cal, MBadPixelsPix &bad, const char* what); 124 128 Bool_t FinalizeCharges ( MCalibrationChargePix &cal, MBadPixelsPix &bad, const char* what); 125 129 Bool_t FinalizePINDiode (); … … 141 145 Bool_t IsCheckHistOverflow () const { return TESTBIT(fCheckFlags,kCheckHistOverflow); } 142 146 Bool_t IsCheckOscillations () const { return TESTBIT(fCheckFlags,kCheckOscillations); } 147 Bool_t IsCheckArrivalTimes () const { return TESTBIT(fCheckFlags,kCheckArrivalTimes); } 143 148 144 149 void PrintUncalibrated( MBadPixelsPix::UncalibratedType_t typ, const char *text) const; … … 182 187 183 188 // Checks 189 void SetCheckArrivalTimes( const Bool_t b=kTRUE ) { 190 b ? SETBIT(fCheckFlags,kCheckArrivalTimes) 191 : CLRBIT(fCheckFlags,kCheckArrivalTimes); } 184 192 void SetCheckDeadPixels( const Bool_t b=kTRUE ) { 185 193 b ? SETBIT(fCheckFlags,kCheckDeadPixels) … … 203 211 void SetPedestals(MPedestalCam *cam) { fPedestals=cam; } 204 212 213 void SetArrTimeRmsLimit ( const Float_t f=fgArrTimeRmsLimit ) { fArrTimeRmsLimit = f; } 205 214 void SetFFactorErrLimit ( const Float_t f=fgFFactorErrLimit ) { fFFactorErrLimit = f; } 206 215 void SetLambdaErrLimit ( const Float_t f=fgLambdaErrLimit ) { fLambdaErrLimit = f; } -
trunk/MagicSoft/Mars/mcalib/MCalibrationChargeCam.cc
r7005 r7013 289 289 { 290 290 291 if ( !pix->IsExcluded())291 if (pix->IsFFactorMethodValid()) 292 292 { 293 293 … … 311 311 312 312 *fLog << all << endl; 313 *fLog << all << " Excluded pixels:" << endl;313 *fLog << all << "Previously Excluded pixels:" << endl; 314 314 *fLog << all << endl; 315 315 … … 329 329 } 330 330 331 *fLog << all << endl; 332 *fLog << all << "New Excluded pixels:" << endl; 333 *fLog << all << endl; 334 335 TIter Next5(fPixels); 336 while ((pix=(MCalibrationChargePix*)Next5())) 337 { 338 if (!pix->IsFFactorMethodValid() && !pix->IsExcluded()) 339 { 340 *fLog << all << pix->GetPixId() << " "; 341 id++; 342 343 if (!(id % 25)) 344 *fLog << endl; 345 } 346 } 347 331 348 *fLog << endl; 332 349 *fLog << all << id << " Excluded pixels " << endl; … … 337 354 *fLog << all << endl; 338 355 339 TIter Next 5(fAverageAreas);340 while ((pix=(MCalibrationChargePix*)Next 5()))356 TIter Next6(fAverageAreas); 357 while ((pix=(MCalibrationChargePix*)Next6())) 341 358 { 342 359 *fLog << all << Form("%s%3i","Area Idx: ",pix->GetPixId()) … … 353 370 *fLog << all << endl; 354 371 355 TIter Next 6(fAverageSectors);356 while ((pix=(MCalibrationChargePix*)Next 6()))372 TIter Next7(fAverageSectors); 373 while ((pix=(MCalibrationChargePix*)Next7())) 357 374 { 358 375 *fLog << all << Form("%s%3i","Sector: ",pix->GetPixId()) … … 482 499 break; 483 500 case 5: 484 if ( pix.IsExcluded())501 if (!pix.IsFFactorMethodValid()) 485 502 return kFALSE; 486 503 if (pix.GetRSigma() == -1.) … … 489 506 break; 490 507 case 6: 491 if ( pix.IsExcluded())508 if (!pix.IsFFactorMethodValid()) 492 509 return kFALSE; 493 510 if (pix.GetRSigma() == -1.) … … 496 513 break; 497 514 case 7: 498 if ( pix.IsExcluded())515 if (!pix.IsFFactorMethodValid()) 499 516 return kFALSE; 500 517 val = pix.GetRSigmaPerCharge(); 501 518 break; 502 519 case 8: 503 if ( pix.IsExcluded())520 if (!pix.IsFFactorMethodValid()) 504 521 return kFALSE; 505 522 val = pix.GetRSigmaPerChargeErr(); 506 523 break; 507 524 case 9: 508 if ( pix.IsExcluded() ||!pix.IsFFactorMethodValid())525 if (!pix.IsFFactorMethodValid()) 509 526 return kFALSE; 510 527 val = pix.GetPheFFactorMethod(); 511 528 break; 512 529 case 10: 513 if ( pix.IsExcluded() ||!pix.IsFFactorMethodValid())530 if (!pix.IsFFactorMethodValid()) 514 531 return kFALSE; 515 532 val = pix.GetPheFFactorMethodErr(); 516 533 break; 517 534 case 11: 518 if ( pix.IsExcluded() ||!pix.IsFFactorMethodValid())535 if (!pix.IsFFactorMethodValid()) 519 536 return kFALSE; 520 537 val = pix.GetMeanConvFADC2Phe(); 521 538 break; 522 539 case 12: 523 if ( pix.IsExcluded() ||!pix.IsFFactorMethodValid())540 if (!pix.IsFFactorMethodValid()) 524 541 return kFALSE; 525 542 val = pix.GetMeanConvFADC2PheErr(); 526 543 break; 527 544 case 13: 528 if ( pix.IsExcluded() ||!pix.IsFFactorMethodValid())545 if (!pix.IsFFactorMethodValid()) 529 546 return kFALSE; 530 547 val = pix.GetMeanFFactorFADC2Phot(); 531 548 break; 532 549 case 14: 533 if ( pix.IsExcluded() ||!pix.IsFFactorMethodValid())550 if (!pix.IsFFactorMethodValid()) 534 551 return kFALSE; 535 552 val = pix.GetMeanFFactorFADC2PhotErr(); … … 625 642 break; 626 643 case 32: 644 if (pix.IsExcluded()) 645 return kFALSE; 627 646 val = pix.GetMean() == 0. ? 0. : pix.GetRms()/pix.GetMean(); 647 break; 648 case 33: 649 if (pix.IsExcluded()) 650 return kFALSE; 651 if (pix.GetMean() == 0.) 652 val = 0.; 653 else 654 val = pix.GetSigmaErr()/pix.GetMean() + pix.GetRms()/pix.GetMean()/pix.GetMean()*pix.GetMeanErr(); 628 655 break; 629 656 default: … … 633 660 return val!=-1.; 634 661 } 635 636 662 637 663 -
trunk/MagicSoft/Mars/mcalib/MCalibrationChargePix.cc
r5200 r7013 69 69 // MHCalibrationChargeCam, MHCalibrationChargePix 70 70 // 71 // 72 // ClassVersion 3: 73 // + fNumSaturated 74 // 71 75 ///////////////////////////////////////////////////////////////////////////// 72 76 #include "MCalibrationChargePix.h" … … 90 94 const Float_t MCalibrationChargePix::fgPheFFactorMethodLimit = 1.; 91 95 const Float_t MCalibrationChargePix::fgConvFFactorRelErrLimit = 0.85; 96 92 97 // -------------------------------------------------------------------------- 93 98 // … … 105 110 // 106 111 MCalibrationChargePix::MCalibrationChargePix(const char *name, const char *title) 107 : fCalibFlags(0) 112 : fCalibFlags(0), fNumSaturated(0) 108 113 { 109 114 … … 158 163 fMeanFFactorFADC2Phot = -1.; 159 164 fMeanFFactorFADC2PhotVar = -1.; 165 166 fNumSaturated = 0; 160 167 161 168 MCalibrationPix::Clear(); -
trunk/MagicSoft/Mars/mcalib/MCalibrationChargePix.h
r5197 r7013 41 41 Float_t fRSigmaSquare; // Square of Reduced sigma 42 42 Float_t fRSigmaSquareVar; // Variance Reduced sigma 43 44 Int_t fNumSaturated; // Number of (high-gain) saturated events 43 45 44 46 enum { kFFactorMethodValid }; // Possible bits to be set … … 71 73 void SetPheFFactorMethodVar ( const Float_t f) { fPheFFactorMethodVar = f; } 72 74 void SetPheFFactorMethodLimit ( const Float_t f=fgPheFFactorMethodLimit ) { fPheFFactorMethodLimit = f; } 75 void SetNumSaturated ( const Int_t i) { fNumSaturated = i; } 73 76 74 77 // Getters … … 90 93 Float_t GetMeanFFactorFADC2PhotErr () const; 91 94 Float_t GetMeanFFactorFADC2PhotVar () const { return fMeanFFactorFADC2PhotVar; } 95 Int_t GetNumSaturated () const { return fNumSaturated; } 92 96 Float_t GetPed () const { return fPed; } 93 97 Float_t GetPedErr () const { return TMath::Sqrt(fPedVar); } … … 113 117 Bool_t CalcMeanFFactor ( const Float_t nphotons, const Float_t nphotonsrelvar ); 114 118 115 ClassDef(MCalibrationChargePix, 2) // Container Charge Calibration Results Pixel119 ClassDef(MCalibrationChargePix, 3) // Container Charge Calibration Results Pixel 116 120 }; 117 121
Note:
See TracChangeset
for help on using the changeset viewer.