Changeset 8478
- Timestamp:
- 05/09/07 13:15:53 (18 years ago)
- Location:
- trunk/MagicSoft/Mars
- Files:
-
- 17 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/Changelog
r8477 r8478 19 19 -*-*- END OF LINE -*-*- 20 20 21 2007/05/09 Thomas Bretz 22 23 * callisto.rc, callisto_Dec04Jan05.rc, callisto_MarApr05.rc, 24 callisto_mux.rc: 25 - changed ArrTimeRmsLimit in all cases to default 5.0 26 because of the new meaning 27 28 * showplot.cc: 29 - changed that it closes automatically if the file cannot 30 be read 31 32 * datacenter/macros/fillstar.C: 33 - commented the output of the query 34 35 * datacenter/macros/plotdb.C: 36 - adapted ranges to MUX data values 37 - added plots for new unsuitable columns 38 39 * mbadpixels/MBadPixelsPix.h: 40 - added a new member function IsUncalibrated 41 - further adapted the usuitable levels 42 43 * mcalib/MCalibrationChargeCalc.[h,cc]: 44 - changed the meaning of ArrTimeRmsLimit such that it is now 45 the deviation from the average rms expressed in significance 46 levels 47 - the new check is done similar to the check for the relative 48 arrival time (to be unified!) 49 - removed FinalizeArrivalTimes 50 - removed calibration levels for first and last bin, this 51 has to be redone more properly taken the extractor properties 52 into account 53 - some updates to the output 54 - some simplifications to the code 55 56 * mcalib/MCalibrationRelTimeCalc.cc: 57 - when calculating the median check for UnsuitableRun not 58 unsuitable in general 59 - small changes to output 60 - calculate upper and lower limits only once 61 62 * mhvstime/MHVsTime.[h,cc]: 63 - added fMinimum and fMaximum data members similar to 64 MHSectorVsTime 65 - to be unified with MHSectorVsTime 66 - fixed draw/paint 67 - increased version number 68 69 * mjobs/MJCalibration.cc: 70 - removed the bad pixel levels for first and last bins 71 72 * msignal/MExtractTimeAndChargeSpline.[h,cc]: 73 - changed to allow setup of the extraction type and the 74 relative or absolute height for arrival 75 - accordingly increased version number by one 76 77 78 21 79 2007/05/08 Daniel Hoehne 22 80 -
trunk/MagicSoft/Mars/callisto.rc
r8451 r8478 214 214 #MJCalibration.MCalibColorSet.ExplicitColor: green,blue,uv,ct1 215 215 216 #MJCalibration.MCalibrationChargeCalc.ArrTimeRmsLimit: 3.5216 #MJCalibration.MCalibrationChargeCalc.ArrTimeRmsLimit: 5.0 217 217 #MJCalibration.MCalibrationChargeCalc.ChargeLimit: 2.5 218 218 #MJCalibration.MCalibrationChargeCalc.ChargeErrLimit: 0 -
trunk/MagicSoft/Mars/callisto_Dec04Jan05.rc
r8439 r8478 238 238 #MJCalibration.MCalibColorSet.ExplicitColor: green,blue,uv,ct1 239 239 240 #MJCalibration.MCalibrationChargeCalc.ArrTimeRmsLimit: 3.5240 #MJCalibration.MCalibrationChargeCalc.ArrTimeRmsLimit: 5.0 241 241 #MJCalibration.MCalibrationChargeCalc.ChargeLimit: 2.5 242 242 #MJCalibration.MCalibrationChargeCalc.ChargeErrLimit: 0 -
trunk/MagicSoft/Mars/callisto_MarApr05.rc
r8439 r8478 238 238 #MJCalibration.MCalibColorSet.ExplicitColor: green,blue,uv,ct1 239 239 240 #MJCalibration.MCalibrationChargeCalc.ArrTimeRmsLimit: 3.5240 #MJCalibration.MCalibrationChargeCalc.ArrTimeRmsLimit: 5.0 241 241 #MJCalibration.MCalibrationChargeCalc.ChargeLimit: 2.5 242 242 #MJCalibration.MCalibrationChargeCalc.ChargeErrLimit: 0 -
trunk/MagicSoft/Mars/callisto_mux.rc
r8452 r8478 238 238 #MJCalibration.MCalibColorSet.ExplicitColor: green,blue,uv,ct1 239 239 240 MJCalibration.MCalibrationChargeCalc.ArrTimeRmsLimit: 2.5 240 #MJCalibration.MCalibrationChargeCalc.ArrTimeRmsLimit: 5.0 241 241 #MJCalibration.MCalibrationChargeCalc.ChargeLimit: 2.5 242 242 #MJCalibration.MCalibrationChargeCalc.ChargeErrLimit: 0 -
trunk/MagicSoft/Mars/datacenter/macros/fillstar.C
r8332 r8478 345 345 } 346 346 347 cout << "Q: " << query << endl;347 // cout << "Q: " << query << endl; 348 348 349 349 if (dummy) -
trunk/MagicSoft/Mars/datacenter/macros/plotdb.C
r8338 r8478 1 1 /* ======================================================================== *\ 2 ! $Name: not supported by cvs2svn $:$Id: plotdb.C,v 1.3 3 2007-02-28 13:50:06tbretz Exp $2 ! $Name: not supported by cvs2svn $:$Id: plotdb.C,v 1.34 2007-05-09 12:15:51 tbretz Exp $ 3 3 ! -------------------------------------------------------------------------- 4 4 ! … … 528 528 //from calib*.root 529 529 plot.SetDescription("Conversion Factor inner Camera;C_{I} [phe/fadc cnts]", "ConvI"); 530 plot.Plot("Calibration.fConvFactorInner", 0, 0. 5, 0.002);530 plot.Plot("Calibration.fConvFactorInner", 0, 0.7, 0.002); 531 531 plot.SetDescription("Mean Arrival Time inner Camera;T_{I} [sl]", "ArrTmI"); 532 plot.Plot("Calibration.fArrTimeMeanInner", 0, 9.0, 0.1);532 plot.Plot("Calibration.fArrTimeMeanInner", 0, 40.0, 0.1); 533 533 plot.SetDescription("RMS Arrival Time inner Camera;\\sigma_{T,I} [sl]", "RmsArrTmI"); 534 plot.Plot("Calibration.fArrTimeRmsInner", 0, 0.8, 0.01);534 plot.Plot("Calibration.fArrTimeRmsInner", 0, 3.0, 0.01); 535 535 plot.SetDescription("Number of unsuitable pixels inner Camera;N{I}", "UnsuitI"); 536 plot.Plot("Calibration.fUnsuitableInner", 0, 25, 1); 536 plot.Plot("Calibration.fUnsuitableInner", 0, 75, 1); 537 plot.SetDescription("Number of unsuitable pixels >50%;N", "Unsuit50"); 538 plot.Plot("Calibration.fUnsuitable50", 0, 75, 1); 539 plot.SetDescription("Number of unsuitable pixels >1%;N", "Unsuit01"); 540 plot.Plot("Calibration.fUnsuitable01", 0, 75, 1); 537 541 538 542 //from signal*.root … … 542 546 plot.Plot("Calibration.fMeanSignalInner", 0, 7.0, 0.05); 543 547 plot.SetDescription("Mean PulsePosCheck (falling edge) inner camera;T [sl]", "ChkPos"); 544 plot.Plot("Calibration.fPulsePosCheckMean", 1, 15.0, 0.1);548 plot.Plot("Calibration.fPulsePosCheckMean", 1, 40.0, 0.1); 545 549 plot.SetDescription("Rms PulsePosCheck (falling edge) inner camera;T [sl]", "ChkRms"); 546 550 plot.Plot("Calibration.fPulsePosCheckRms", 0, 5.0, 0.1); 547 551 plot.SetDescription("Mean calibrated PulsePos;T", "PulPos"); 548 plot.Plot("Calibration.fPulsePosMean", 1, 15.0, 0.1);552 plot.Plot("Calibration.fPulsePosMean", 1, 40.0, 0.1); 549 553 plot.SetDescription("Rms calibrated PulsePos;T", "PulRms"); 550 plot.Plot("Calibration.fPulsePosRms", 0, 2.0, 0.02);554 plot.Plot("Calibration.fPulsePosRms", 0, 3.0, 0.02); 551 555 552 556 plot.SetDescription("Hi-/Lo-Gain offset;", "PulOff"); … … 606 610 //from calib*.root 607 611 plot.SetDescription("Conversion Factor outer Camera;C_{O} [phe/fadc cnts]", "ConvO"); 608 plot.Plot("Calibration.fConvFactorOuter", 0, 2.0, 0.01);612 plot.Plot("Calibration.fConvFactorOuter", 0, 3.0, 0.01); 609 613 plot.SetDescription("Mean Arrival Time outer Camera;T_{O} [sl]", "ArrTmO"); 610 plot.Plot("Calibration.fArrTimeMeanOuter", 0, 8.5, 0.1);614 plot.Plot("Calibration.fArrTimeMeanOuter", 0, 45, 0.1); 611 615 plot.SetDescription("RMS Arrival Time outer Camera;\\sigma_{T,O} [sl]", "RmsArrTmO"); 612 plot.Plot("Calibration.fArrTimeRmsOuter", 0, 1.0, 0.01);616 plot.Plot("Calibration.fArrTimeRmsOuter", 0, 3.0, 0.01); 613 617 plot.SetDescription("Number of unsuitable pixels outer Camera;N{O}", "UnsuitO"); 614 618 plot.Plot("Calibration.fUnsuitableOuter", 0, 25, 1); -
trunk/MagicSoft/Mars/mbadpixels/MBadPixelsPix.h
r8458 r8478 82 82 Bool_t IsHardwareBad (HardwareType_t typ) const { return fInfo[2]&typ; } 83 83 84 Bool_t IsUnsuitable() const { return fInfo[0]&kUnsuitable; } 85 Bool_t IsUnreliable() const { return fInfo[0]&kUnreliable; } 84 Bool_t IsUnsuitable() const { return fInfo[0]&kUnsuitable; } 85 Bool_t IsUnreliable() const { return fInfo[0]&kUnreliable; } 86 Bool_t IsUncalibrated() const { return fInfo[1]!=0; } 86 87 87 88 Bool_t IsOK() const { return fInfo[0]==0; } … … 100 101 if (IsUncalibrated( kChargeIsPedestal )) return 1; 101 102 if (IsUncalibrated( kLoGainSaturation )) return 2; 102 if (IsUncalibrated( kMeanTimeInFirstBin )) return 3;103 if (IsUncalibrated( kMeanTimeInLast2Bins )) return 4;104 if (IsUncalibrated( kHiGainOverFlow )) return 5;105 if (IsUncalibrated( kLoGainOverFlow )) return 6;106 if (IsUncalibrated( kDeadPedestalRms )) return 7;107 if (IsUncalibrated( k FluctuatingArrivalTimes)) return 8;108 if (IsUncalibrated( k DeviatingNumPhes )) return 9;109 if (IsUncalibrated( kDeviatingTimeResolution)) return 10;110 if (IsUncalibrated( kLoGainBlackout )) return 11;111 if (IsUncalibrated( kPreviouslyExcluded )) return 1 2;112 return 1 3;103 // if (IsUncalibrated( kMeanTimeInFirstBin )) return 3; 104 // if (IsUncalibrated( kMeanTimeInLast2Bins )) return 4; 105 if (IsUncalibrated( kHiGainOverFlow )) return 3; 106 if (IsUncalibrated( kLoGainOverFlow )) return 4; 107 if (IsUncalibrated( kDeadPedestalRms )) return 5; 108 if (IsUncalibrated( kDeviatingNumPhes )) return 6; 109 if (IsUncalibrated( kFluctuatingArrivalTimes)) return 7; 110 if (IsUncalibrated( kDeviatingTimeResolution)) return 8; 111 if (IsUncalibrated( kLoGainBlackout )) return 9; 112 if (IsUncalibrated( kPreviouslyExcluded )) return 10; 113 return 11; 113 114 } 114 115 -
trunk/MagicSoft/Mars/mcalib/MCalibrationChargeCalc.cc
r8452 r8478 1 1 /* ======================================================================== *\ 2 ! $Name: not supported by cvs2svn $:$Id: MCalibrationChargeCalc.cc,v 1.17 7 2007-04-27 10:04:46tbretz Exp $2 ! $Name: not supported by cvs2svn $:$Id: MCalibrationChargeCalc.cc,v 1.178 2007-05-09 12:15:52 tbretz Exp $ 3 3 ! -------------------------------------------------------------------------- 4 4 ! … … 19 19 ! 20 20 ! Author(s): Markus Gaug 02/2004 <mailto:markus@ifae.es> 21 ! Author(s): Thomas Bretz <mailto:tbretz@astro.uni-wuerzburg.de> 21 22 ! 22 ! Copyright: MAGIC Software Development, 2000-200 423 ! Copyright: MAGIC Software Development, 2000-2007 23 24 ! 24 25 ! … … 213 214 #include "MLogManip.h" 214 215 216 #include "MMath.h" 217 215 218 #include "MParList.h" 216 219 … … 255 258 const Float_t MCalibrationChargeCalc::fgPheErrUpperLimit = 5.5; 256 259 const Float_t MCalibrationChargeCalc::fgFFactorErrLimit = 4.5; 257 const Float_t MCalibrationChargeCalc::fgArrTimeRmsLimit = 3.5;260 const Float_t MCalibrationChargeCalc::fgArrTimeRmsLimit = 5.0; 258 261 const Float_t MCalibrationChargeCalc::fgUnsuitablesLimit = 0.1; 259 262 const Float_t MCalibrationChargeCalc::fgUnreliablesLimit = 0.3; … … 672 675 } 673 676 677 // ---------------------------------------------------------------------------------------------------- 678 // 679 // Check for outliers. They are marked with 680 // MBadPixelsPix::kFluctuatingArrivalTimes 681 // 682 // see also MCalibrationRelTimeCalc::FinalizeRelTimes 683 // 684 void MCalibrationChargeCalc::FinalizeAbsTimes() 685 { 686 const Int_t npixels = fGeom->GetNumPixels(); 687 const Int_t nareas = fGeom->GetNumAreas(); 688 689 // Create an array capable of holding all pixels 690 TArrayF arr(npixels); 691 692 for (Int_t aidx=0; aidx<nareas; aidx++) 693 { 694 Int_t n = 0; 695 for (Int_t i=0; i<npixels; i++) 696 { 697 // Check for this aidx only 698 if ((*fGeom)[i].GetAidx()!=aidx) 699 continue; 700 701 // check if pixel may not contain a valid value 702 if ((*fBadPixels)[i].IsUnsuitable(MBadPixelsPix::kUnsuitableRun)) 703 continue; 704 705 // check if it was excluded for some reason 706 const MCalibrationChargePix &pix = (MCalibrationChargePix&)(*fCam)[i]; 707 if (pix.IsExcluded()) 708 continue; 709 710 // if TimePrecision is valid fill it into array 711 if (pix.GetAbsTimeRms()>0) 712 arr[n++] = pix.GetAbsTimeRms(); 713 } 714 715 // Check the ratio of valid entries to the ratio of pixels 716 const Float_t ratio = 100*n/fGeom->GetNumPixWithAidx(aidx); 717 if (3*ratio<2) 718 *fLog << warn << "Area " << setw(4) << aidx << ": Only " << ratio << "% pixels with valid time resolution found." << endl; 719 720 // Calculate median and median deviation 721 Double_t med; 722 const Double_t dev = MMath::MedianDev(n, arr.GetArray(), med); 723 724 // Calculate upper and lower limit 725 const Float_t lolim = TMath::Max(med-fArrTimeRmsLimit*dev, 0.); 726 const Float_t hilim = TMath::Max(med+fArrTimeRmsLimit*dev, 0.); 727 728 // Now find the outliers 729 for (Int_t i=0; i<npixels; i++) 730 { 731 // Search only within this aidx 732 if ((*fGeom)[i].GetAidx()!=aidx) 733 continue; 734 735 // skip pixels already known to be unsuitable 736 if ((*fBadPixels)[i].IsUnsuitable(MBadPixelsPix::kUnsuitableRun)) 737 continue; 738 739 // check if a pixel has been excluded. This 740 const MCalibrationChargePix &pix = (MCalibrationChargePix&)(*fCam)[i]; 741 742 // Check if time precision is valid (might be invalid 743 // for example in cae of empty histograms) 744 const Float_t res = pix.GetAbsTimeRms(); 745 if (res<0) //FIXME!!! How does this happen? 746 { 747 *fLog << warn << "Pixel " << setw(4) << i << ": Abs-time resolution could not be calculated." << endl; 748 (*fBadPixels)[i].SetUncalibrated(MBadPixelsPix::kDeviatingTimeResolution); 749 continue; 750 } 751 752 // Now compare to a lower and upper limit 753 if (res<=lolim || res>=hilim) 754 { 755 *fLog << warn << "Pixel " << setw(4) << i << ": Deviating abs-time resolution: " 756 << Form("%5.2f", res) << " out of range " 757 << Form("[%4.2f,%4.2f]", lolim, hilim) << endl; 758 759 (*fBadPixels)[i].SetUncalibrated(MBadPixelsPix::kFluctuatingArrivalTimes); 760 } 761 } 762 } 763 } 764 674 765 // ----------------------------------------------------------------------- 675 766 // … … 723 814 // First loop over pixels, call FinalizePedestals and FinalizeCharges 724 815 // 725 Int_t nvalid = 0; 726 816 Int_t nvalid = 0; 727 817 for (Int_t pixid=0; pixid<fPedestals->GetSize(); pixid++) 728 { 729 730 MCalibrationChargePix &pix = (MCalibrationChargePix&)(*fCam)[pixid]; 818 { 731 819 // 732 820 // Check if the pixel has been excluded from the fits 733 821 // 822 MCalibrationChargePix &pix = (MCalibrationChargePix&)(*fCam)[pixid]; 734 823 if (pix.IsExcluded()) 735 continue; 736 737 MPedestalPix &ped = (*fPedestals)[pixid]; 738 MBadPixelsPix &bad = (*fBadPixels)[pixid]; 739 740 const Int_t aidx = (*fGeom)[pixid].GetAidx(); 741 742 FinalizePedestals(ped,pix,aidx); 743 744 if (FinalizeCharges(pix,bad,"pixel ")) 745 nvalid++; 746 747 FinalizeArrivalTimes(pix,bad,"pixel "); 748 } 824 continue; 825 826 FinalizePedestals((*fPedestals)[pixid], pix, (*fGeom)[pixid].GetAidx()); 827 828 if (FinalizeCharges(pix, (*fBadPixels)[pixid], "Pixel ")) 829 nvalid++; 830 } 831 832 FinalizeAbsTimes(); 749 833 750 834 *fLog << endl; … … 779 863 // (already done for calibration sigma in MHCalibrationCam::CalcAverageSigma() 780 864 // 781 pix.SetPedRMS(pix.GetPedRms()*TMath::Sqrt((Float_t)arr[aidx]), 782 pix.GetPedRmsErr()*TMath::Sqrt((Float_t)arr[aidx])); 865 const Double_t sqrtnum = TMath::Sqrt((Double_t)arr[aidx]); 866 867 pix.SetPedRMS(pix.GetPedRms()*sqrtnum, pix.GetPedRmsErr()*sqrtnum); 783 868 pix.SetSigma (pix.GetSigma()/pix.GetFFactorFADC2Phe()); 784 869 785 870 FinalizeCharges(pix, fCam->GetAverageBadArea(aidx),"area id"); 786 FinalizeArrivalTimes(pix, fCam->GetAverageBadArea(aidx), "area id");787 871 } 788 872 … … 850 934 PrintUncalibrated(MBadPixelsPix::kLoGainSaturation, 851 935 "Low Gain Saturation: "); 852 PrintUncalibrated(MBadPixelsPix::kMeanTimeInFirstBin, 853 Form("%s%2.1f%s","Mean Abs. Arr. Time in First ",1.," Bin(s): "));854 PrintUncalibrated(MBadPixelsPix::kMeanTimeInLast2Bins, 855 Form("%s%2.1f%s","Mean Abs. Arr. Time in Last ",2.," Bin(s): "));936 // PrintUncalibrated(MBadPixelsPix::kMeanTimeInFirstBin, 937 // Form("%s%2.1f%s","Mean Abs. Arr. Time in First ",1.," Bin(s): ")); 938 // PrintUncalibrated(MBadPixelsPix::kMeanTimeInLast2Bins, 939 // Form("%s%2.1f%s","Mean Abs. Arr. Time in Last ",2.," Bin(s): ")); 856 940 PrintUncalibrated(MBadPixelsPix::kHiGainOverFlow, 857 941 "Pixels with High Gain Overflow: "); … … 974 1058 const TString desc = Form("%7s%4d: ", what, cal.GetPixId()); 975 1059 1060 if (cal.GetMean()<0) 1061 { 1062 *fLog << warn << desc << "Charge not fitted." << endl; 1063 bad.SetUncalibrated( MBadPixelsPix::kChargeIsPedestal); 1064 return kFALSE; 1065 } 1066 1067 if (cal.GetSigma()<0) 1068 { 1069 *fLog << warn << desc << "Charge Sigma invalid." << endl; 1070 bad.SetUncalibrated( MBadPixelsPix::kChargeIsPedestal); 1071 return kFALSE; 1072 } 1073 976 1074 if (cal.GetMean() < fChargeLimit*cal.GetPedRms()) 977 1075 { … … 1084 1182 1085 1183 return kTRUE; 1086 }1087 1088 // -----------------------------------------------------------------------------------1089 //1090 // Test the arrival Times RMS of the pixel and set the bit1091 // - MBadPixelsPix::kFluctuatingArrivalTimes1092 //1093 void MCalibrationChargeCalc::FinalizeArrivalTimes(MCalibrationChargePix &cal, MBadPixelsPix &bad, const char* what)1094 {1095 if (bad.IsUnsuitable(MBadPixelsPix::kUnsuitableRun))1096 return;1097 1098 const TString desc = Form("%7s%4d: ", what, cal.GetPixId());1099 1100 if (cal.GetAbsTimeRms() > fArrTimeRmsLimit)1101 {1102 *fLog << warn;1103 *fLog << desc << "RMS of pulse arrival times: " << Form("%2.1f", cal.GetAbsTimeRms());1104 *fLog << " FADC sl. < " << Form("%2.1f", fArrTimeRmsLimit) << endl;1105 bad.SetUncalibrated( MBadPixelsPix::kFluctuatingArrivalTimes);1106 }1107 1184 } 1108 1185 … … 1134 1211 bad.SetUnsuitable( MBadPixelsPix::kUnsuitableRun ); 1135 1212 } 1136 1213 /* 1137 1214 if (IsCheckExtractionWindow()) 1138 1215 { … … 1143 1220 bad.SetUnsuitable( MBadPixelsPix::kUnsuitableRun ); 1144 1221 } 1145 1222 */ 1146 1223 if (IsCheckDeviatingBehavior()) 1147 1224 { … … 1275 1352 continue; 1276 1353 } 1277 1354 1355 // FIXME: WHAT IS THIS FOR? It is overwritten! 1278 1356 lowlim[i] = areaphes[i] - fPheErrLowerLimit*TMath::Sqrt(areavars[i]); 1279 1357 upplim[i] = areaphes[i] + fPheErrUpperLimit*TMath::Sqrt(areavars[i]); -
trunk/MagicSoft/Mars/mcalib/MCalibrationChargeCalc.h
r8452 r8478 83 83 84 84 // Pointers 85 // MBadPixelsIntensityCam *fIntensBad; //! Bad Pixels86 85 MBadPixelsCam *fBadPixels; //! Bad Pixels 87 86 MCalibrationChargeCam *fCam; //! Calibrated Charges results of all pixels … … 128 127 129 128 // functions 130 void FinalizeArrivalTimes ( MCalibrationChargePix &cal, MBadPixelsPix &bad, const char* what);131 129 void FinalizeBadPixels (); 132 130 Bool_t FinalizeBlindCam (); … … 141 139 Bool_t FinalizeUnsuitablePixels(); 142 140 141 void FinalizeAbsTimes(); 142 143 143 const char* GetOutputFile(); 144 144 -
trunk/MagicSoft/Mars/mcalib/MCalibrationRelTimeCalc.cc
r8458 r8478 17 17 ! 18 18 ! Author(s): Markus Gaug 04/2004 <mailto:markus@ifae.es> 19 ! 20 ! Copyright: MAGIC Software Development, 2000-2004 19 ! Author(s): Thomas Bretz <mailto:tbretz@astro.uni-wuerzburg.de> 20 ! 21 ! Copyright: MAGIC Software Development, 2000-2007 21 22 ! 22 23 ! … … 242 243 // MBadPixelsPix::kDeviatingTimeResolution 243 244 // 245 // see also MCalibrationChargeCalc::FinalizeAbsTimes 246 // 244 247 void MCalibrationRelTimeCalc::FinalizeRelTimes() 245 248 { … … 260 263 261 264 // check if pixel may not contain a valid value 262 if ((*fBadPixels)[i].IsUnsuitable( ))265 if ((*fBadPixels)[i].IsUnsuitable(MBadPixelsPix::kUnsuitableRun)) 263 266 continue; 264 267 … … 281 284 Double_t med; 282 285 const Double_t dev = MMath::MedianDev(n, arr.GetArray(), med); 286 287 // Calculate upper and lower limit 288 const Float_t lolim = TMath::Max(med-fRelTimeResolutionLimit*dev, 0.); 289 const Float_t hilim = TMath::Max(med+fRelTimeResolutionLimit*dev, 0.); 283 290 284 291 // Now find the outliers … … 290 297 291 298 // skip pixels already known to be unsuitable 292 if ((*fBadPixels)[i].IsUnsuitable( ))299 if ((*fBadPixels)[i].IsUnsuitable(MBadPixelsPix::kUnsuitableRun)) 293 300 continue; 294 301 … … 301 308 if (res<0) //FIXME!!! How does this happen? 302 309 { 303 *fLog << warn << "Pixel " << setw(4) << i << ": Time resolution could not be calculated." << endl;310 *fLog << warn << "Pixel " << setw(4) << i << ": Rel-time resolution could not be calculated." << endl; 304 311 (*fBadPixels)[i].SetUncalibrated(MBadPixelsPix::kDeviatingTimeResolution); 305 312 continue; … … 307 314 308 315 // Now compare to a lower and upper limit 309 const Float_t lolim = TMath::Max(med-fRelTimeResolutionLimit*dev, 0.);310 const Float_t hilim = TMath::Max(med+fRelTimeResolutionLimit*dev, 0.);311 312 316 if (res<=lolim || res>=hilim) 313 317 { 314 *fLog << warn << "Pixel " << setw(4) << i << ": Deviating time resolution: "315 << Form("% 4.2f", res) << " out of range "318 *fLog << warn << "Pixel " << setw(4) << i << ": Deviating rel-time resolution: " 319 << Form("%5.2f", res) << " out of range " 316 320 << Form("[%4.2f,%4.2f]", lolim, hilim) << endl; 317 321 -
trunk/MagicSoft/Mars/mhvstime/MHVsTime.cc
r8082 r8478 18 18 ! Author(s): Thomas Bretz, 11/2003 <mailto:tbretz@astro.uni-wuerzburg.de> 19 19 ! 20 ! Copyright: MAGIC Software Development, 2000-200 420 ! Copyright: MAGIC Software Development, 2000-2007 21 21 ! 22 22 ! … … 58 58 // - MDataChain *fError; // Object from which the error is filled 59 59 // 60 // Class Version 3: 61 // ---------------- 62 // + Double_t fMinimum; // User defined minimum 63 // + Double_t fMaximum; // User defined maximum 64 // 60 65 ///////////////////////////////////////////////////////////////////////////// 61 66 #include "MHVsTime.h" … … 92 97 MHVsTime::MHVsTime(const char *rule, const char *error) 93 98 : fGraph(NULL), fData(NULL), fError(NULL), fScale(1), fMaxPts(-1), 94 fNumEvents(1), f UseEventNumber(0)99 fNumEvents(1), fMinimum(-1111), fMaximum(-1111), fUseEventNumber(0) 95 100 { 96 101 fName = gsDefName; … … 129 134 // -------------------------------------------------------------------------- 130 135 // 131 // Call SetMinimum of fGraph132 //133 void MHVsTime::SetMinimum(Double_t min)134 {135 if (fGraph)136 fGraph->SetMinimum(min);137 }138 139 // --------------------------------------------------------------------------140 //141 136 // Return the data members used by the data chain to be used in 142 137 // MTask::AddBranchToList … … 178 173 fMean = 0; 179 174 fN = 0; 175 176 fMin = FLT_MAX; 177 fMax = -FLT_MAX; 180 178 181 179 return kTRUE; … … 252 250 } 253 251 254 fGraph->SetPoint(fGraph->GetN(), t, fMean/fN*fScale); 252 const Double_t val = fMean/fN*fScale; 253 254 fGraph->SetPoint(fGraph->GetN(), t, val); 255 255 256 256 if (fError) 257 257 static_cast<TGraphErrors*>(fGraph)->SetPointError(fGraph->GetN()-1, 0, fMeanErr/fN*fScale); 258 259 fMin = TMath::Min(fMin, val); 260 fMax = TMath::Max(fMax, val); 258 261 259 262 fMean = 0; … … 265 268 } 266 269 270 // -------------------------------------------------------------------------- 271 // 272 // Set Minimum and Maximum; 273 Bool_t MHVsTime::Finalize() 274 { 275 const Double_t add = (fMax-fMin)*0.15; 276 277 if (fMinimum==-1111) 278 fGraph->SetMinimum(fMin-add); 279 if (fMaximum==-1111) 280 fGraph->SetMaximum(fMax+add); 281 282 return kTRUE; 283 } 284 267 285 void MHVsTime::Paint(Option_t *opt) 268 286 { 269 /*270 *fLog << all << fGraph << " " << gPad->GetName() << " ----> Paint " << opt << endl;271 TListIter Next(gPad->GetListOfPrimitives()); TObject *obj;272 while ((obj=Next())) *fLog << obj << " " << obj->GetName() << " " << obj->ClassName() << " " << Next.GetOption() << endl;273 */274 287 if (!fGraph) 275 288 return; 276 277 // *fLog << all << fGraph->GetN() << " " << opt << endl;278 289 279 290 if (fGraph->GetN()==0) … … 318 329 gPad->SetLogy(); 319 330 331 // If this is set to early the plot remains empty in root 5.12/00 332 if (fMinimum!=-1111) 333 fGraph->SetMinimum(fMinimum); 334 if (fMaximum!=-1111) 335 fGraph->SetMaximum(fMaximum); 336 337 320 338 // This is a workaround if the TGraph has only one point. 321 339 // Otherwise MStatusDisplay::Update hangs. 322 // gPad->GetListOfPrimitives()->Remove(fGraph); 323 // fGraph->Draw(fGraph->GetN()<2 ? "A" : str.Data()); 324 //gPad->GetListOfPrimitives()->Add(fGraph, fGraph->GetN()<2 ? "A" : opt); 325 // AppendPad(str); 326 // fGraph->Draw(str); 327 340 gPad->GetListOfPrimitives()->Remove(fGraph); 341 fGraph->Draw(fGraph->GetN()<2 ? "A" : str.Data()); 328 342 } 329 343 … … 339 353 pad->SetBorderMode(0); 340 354 AppendPad(opt); 341 342 fGraph->Draw("A");343 355 } 344 356 -
trunk/MagicSoft/Mars/mhvstime/MHVsTime.h
r8082 r8478 34 34 MTime fLast; //! For checks 35 35 36 Double_t fMinimum; // User defined minimum 37 Double_t fMaximum; // User defined maximum 38 39 Double_t fMin; //! Calculation of minimum 40 Double_t fMax; //! Calculation of maximum 41 36 42 enum { 37 43 kIsLogy = BIT(18) … … 40 46 Bool_t fUseEventNumber; 41 47 48 Bool_t Finalize(); 49 42 50 public: 43 51 MHVsTime(const char *rule=NULL, const char *ruleerr=NULL); … … 45 53 46 54 void SetScale(Double_t scale) { fScale = scale; } 47 void SetMinimum(Double_t min=-1111); 55 56 void SetMinimum(Double_t min=-1111) { fMinimum = min; } 57 void SetMaximum(Double_t max=-1111) { fMaximum = max; } 48 58 49 59 Int_t GetNbins() const; … … 78 88 void SetMaxPts(Int_t n) { fMaxPts=n; } 79 89 80 ClassDef(MHVsTime, 2) // Generalized 1/2/3D-histogram for Mars variables90 ClassDef(MHVsTime, 3) // Generalized 1/2/3D-histogram for Mars variables 81 91 }; 82 92 -
trunk/MagicSoft/Mars/mjobs/MJCalibration.cc
r8455 r8478 829 829 830 830 const Double_t min = 1; 831 const Double_t max = 1 2.;831 const Double_t max = 10.; 832 832 const Double_t f = (numcol-1)/(max-min); 833 833 … … 848 848 DrawBadPixel(*pave, disp24, 1, f, "Signal smaller 4.5 Pedestal RMS: "); 849 849 DrawBadPixel(*pave, disp24, 2, f, "Low Gain Saturation: "); 850 DrawBadPixel(*pave, disp24, 3, f, "Mean Arr. Time In First Extraction Bin: ");851 DrawBadPixel(*pave, disp24, 4, f, "Mean Arr. Time In Last 2 Extraction Bins: ");852 DrawBadPixel(*pave, disp24, 5, f, "High-Gain Histogram Overflow: ");853 DrawBadPixel(*pave, disp24, 6, f, "Low-Gain Histogram Overflow: ");854 DrawBadPixel(*pave, disp24, 7, f, "Presumably dead from Ped. Rms: ");855 DrawBadPixel(*pave, disp24, 8, f, "Fluctuating Pulse Arrival Times:");856 DrawBadPixel(*pave, disp24, 9, f, "Deviating Number of Photo-electrons:");857 DrawBadPixel(*pave, disp24, 10, f, "Deviating Rel. Arrival Time RMS: ");858 DrawBadPixel(*pave, disp24, 11, f, "Too many Low-Gain Blackout Events: ");859 DrawBadPixel(*pave, disp24, 1 2, f, "Previously Excluded: ");850 // DrawBadPixel(*pave, disp24, 3, f, "Mean Arr. Time In First Extraction Bin: "); 851 // DrawBadPixel(*pave, disp24, 4, f, "Mean Arr. Time In Last 2 Extraction Bins: "); 852 DrawBadPixel(*pave, disp24, 3, f, "High-Gain Histogram Overflow: "); 853 DrawBadPixel(*pave, disp24, 4, f, "Low-Gain Histogram Overflow: "); 854 DrawBadPixel(*pave, disp24, 5, f, "Presumably dead from Ped. Rms: "); 855 DrawBadPixel(*pave, disp24, 6, f, "Deviating Number of Photo-electrons: "); 856 DrawBadPixel(*pave, disp24, 7, f, "Fluctuating Pulse Arrival Times: "); 857 DrawBadPixel(*pave, disp24, 8, f, "Deviating Rel. Arrival Time RMS: "); 858 DrawBadPixel(*pave, disp24, 9, f, "Too many Low-Gain Blackout Events: "); 859 DrawBadPixel(*pave, disp24, 10, f, "Previously Excluded: "); 860 860 pave->Draw(); 861 861 -
trunk/MagicSoft/Mars/msignal/MExtractTimeAndChargeSpline.cc
r8368 r8478 1 1 /* ======================================================================== *\ 2 ! $Name: not supported by cvs2svn $:$Id: MExtractTimeAndChargeSpline.cc,v 1.6 7 2007-03-05 08:55:09tbretz Exp $2 ! $Name: not supported by cvs2svn $:$Id: MExtractTimeAndChargeSpline.cc,v 1.68 2007-05-09 12:15:53 tbretz Exp $ 3 3 ! -------------------------------------------------------------------------- 4 4 ! … … 20 20 ! Author(s): Markus Gaug 09/2004 <mailto:markus@ifae.es> 21 21 ! 22 ! Copyright: MAGIC Software Development, 2002-200 622 ! Copyright: MAGIC Software Development, 2002-2007 23 23 ! 24 24 ! … … 145 145 #include "MExtractTimeAndChargeSpline.h" 146 146 147 #include "MExtralgoSpline.h"148 149 147 #include "MPedestalPix.h" 150 148 … … 181 179 // 182 180 MExtractTimeAndChargeSpline::MExtractTimeAndChargeSpline(const char *name, const char *title) 183 : f ExtractionType(kIntegral)181 : fHeightTm(0.5), fExtractionType(MExtralgoSpline::kIntegralRel) 184 182 { 185 183 … … 220 218 // second derivative to zero, there. 221 219 // 222 void MExtractTimeAndChargeSpline::SetChargeType( ExtractionType_t typ)220 void MExtractTimeAndChargeSpline::SetChargeType(MExtralgoSpline::ExtractionType_t typ) 223 221 { 224 222 fExtractionType = typ; … … 228 226 switch (fExtractionType) 229 227 { 230 case kAmplitude:228 case MExtralgoSpline::kAmplitude: 231 229 SetResolutionPerPheHiGain(0.053); 232 230 SetResolutionPerPheLoGain(0.016); 233 231 return; 234 232 235 case kIntegral: 233 case MExtralgoSpline::kIntegralRel: 234 case MExtralgoSpline::kIntegralAbs: 236 235 switch (fWindowSizeHiGain) 237 236 { … … 305 304 switch (fExtractionType) 306 305 { 307 case kAmplitude:306 case MExtralgoSpline::kAmplitude: 308 307 fNumHiGainSamples = 1.; 309 308 fNumLoGainSamples = fLoGainLast ? 1. : 0.; … … 315 314 break; 316 315 317 case kIntegral: 316 case MExtralgoSpline::kIntegralAbs: 317 case MExtralgoSpline::kIntegralRel: 318 318 fNumHiGainSamples = fRiseTimeHiGain + fFallTimeHiGain; 319 319 fNumLoGainSamples = fLoGainLast ? fRiseTimeLoGain + fFallTimeLoGain : 0.; … … 336 336 MExtralgoSpline s(ptr, num, fHiGainFirstDeriv.GetArray(), fHiGainSecondDeriv.GetArray()); 337 337 338 s.SetExtractionType(fExtractionType); 339 s.SetHeightTm(fHeightTm); 338 340 s.SetRiseFallTime(fRiseTimeHiGain, fFallTimeHiGain); 339 341 … … 357 359 MExtralgoSpline s(ptr, num, fLoGainFirstDeriv.GetArray(), fLoGainSecondDeriv.GetArray()); 358 360 361 s.SetExtractionType(fExtractionType); 362 s.SetHeightTm(fHeightTm); 359 363 s.SetRiseFallTime(fRiseTimeLoGain, fFallTimeLoGain); 360 364 … … 404 408 rc = kTRUE; 405 409 } 406 410 if (IsEnvDefined(env, prefix, "HeightTm", print)) 411 { 412 fHeightTm = GetEnvValue(env, prefix, "HeightTm", fHeightTm); 413 rc = kTRUE; 414 } 415 407 416 if (IsEnvDefined(env, prefix, "ExtractionType", print)) 408 417 { … … 411 420 type = type.Strip(TString::kBoth); 412 421 if (type==(TString)"amplitude") 413 SetChargeType(kAmplitude); 414 if (type==(TString)"integral") 415 SetChargeType(kIntegral); 422 SetChargeType(MExtralgoSpline::kAmplitude); 423 if (type==(TString)"integralabsolute") 424 SetChargeType(MExtralgoSpline::kIntegralAbs); 425 if (type==(TString)"integralrelative") 426 SetChargeType(MExtralgoSpline::kIntegralRel); 416 427 rc=kTRUE; 417 428 } -
trunk/MagicSoft/Mars/msignal/MExtractTimeAndChargeSpline.h
r8304 r8478 4 4 #ifndef MARS_MExtractTimeAndCharge 5 5 #include "MExtractTimeAndCharge.h" 6 #endif 7 8 #ifndef MARS_MExtralgoSpline 9 #include "MExtralgoSpline.h" 6 10 #endif 7 11 … … 41 45 42 46 Float_t fLoGainStretch; // The stretch of the low-gain w.r.t. the high-gain pulse 47 Float_t fHeightTm; 43 48 44 49 // Int_t fRandomIter; //! Counter used to randomize weights for noise calculation … … 47 52 Bool_t InitArrays(Int_t n); 48 53 49 public:50 enum ExtractionType_t { kAmplitude, kIntegral }; //! Possible time and charge extraction types51 52 54 private: 53 ExtractionType_t fExtractionType;55 MExtralgoSpline::ExtractionType_t fExtractionType; 54 56 55 57 public: 56 58 MExtractTimeAndChargeSpline(const char *name=NULL, const char *title=NULL); 57 ~MExtractTimeAndChargeSpline() {}58 59 59 60 Float_t GetRiseTimeHiGain() const { return fRiseTimeHiGain; } … … 83 84 void SetLoGainStretch(const Float_t f=fgLoGainStretch) { fLoGainStretch = f; } 84 85 85 void SetChargeType(const ExtractionType_t typ=kIntegral);86 void SetChargeType(const MExtralgoSpline::ExtractionType_t typ=MExtralgoSpline::kIntegralRel); 86 87 /* 87 88 void FindTimeAndChargeHiGain(Byte_t *first, Byte_t *logain, Float_t &sum, Float_t &dsum, … … 100 101 Byte_t sat, Int_t maxpos) const; 101 102 102 ClassDef(MExtractTimeAndChargeSpline, 4) // Task to Extract Arrival Times and Charges using a Cubic Spline103 ClassDef(MExtractTimeAndChargeSpline, 5) // Task to Extract Arrival Times and Charges using a Cubic Spline 103 104 }; 104 105 -
trunk/MagicSoft/Mars/showplot.cc
r8088 r8478 258 258 d->SetCanvasWidth(kCanvasWidth); 259 259 260 d->Open(kInput);260 const Int_t rc = d->Open(kInput); 261 261 262 262 if (kPrint) … … 285 285 d->SaveAsC(kTab, kNameC); 286 286 287 if (kBatch || kQuit )287 if (kBatch || kQuit || !rc) 288 288 { 289 289 delete d;
Note:
See TracChangeset
for help on using the changeset viewer.