Changeset 8192 for trunk/MagicSoft/Mars/mhcalib
- Timestamp:
- 11/01/06 15:48:31 (18 years ago)
- Location:
- trunk/MagicSoft/Mars/mhcalib
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/mhcalib/MHCalibrationChargeCam.cc
r8147 r8192 1 1 /* ======================================================================== *\ 2 ! $Name: not supported by cvs2svn $:$Id: MHCalibrationChargeCam.cc,v 1.46 2006-11-01 15:48:31 tbretz Exp $ 3 ! -------------------------------------------------------------------------- 2 4 ! 3 5 ! * … … 17 19 ! 18 20 ! Author(s): Markus Gaug 02/2004 <mailto:markus@ifae.es> 21 ! Author(s): Thomas Bretz <mailto:tbretz@astro.uni-wuerzburg.de> 19 22 ! 20 ! Copyright: MAGIC Software Development, 2000-200 423 ! Copyright: MAGIC Software Development, 2000-2006 21 24 ! 22 25 ! … … 709 712 710 713 for (UInt_t i=0; i<npixels; i++) 711 { 712 714 { 713 715 MHCalibrationChargePix &histhi = (MHCalibrationChargePix&)(*this)[i]; 714 715 716 if (histhi.IsExcluded()) 716 717 continue; 717 718 718 const MExtractedSignalPix &pix = (*signal)[i];719 720 const Float_t sumhi = pix.GetExtractedSignalHiGain();721 const Int_t sathi = pix.IsHiGainSaturated() ? 1 : 0;722 723 if (IsOscillations())724 histhi.FillHistAndArray(sumhi);725 else726 histhi.FillHist(sumhi);727 728 histhi.AddSaturated(sathi);729 730 719 const Int_t aidx = (*fGeom)[i].GetAidx(); 731 720 const Int_t sector = (*fGeom)[i].GetSector(); 732 721 733 fSumhiarea[aidx] += sumhi; 734 fSumhisector[sector] += sumhi; 722 const MExtractedSignalPix &pix = (*signal)[i]; 723 724 const Int_t sathi = pix.IsHiGainSaturated() ? 1 : 0; 725 histhi.AddSaturated(sathi); 735 726 if (sathi) 736 727 { … … 739 730 } 740 731 741 if (IsLoGain()) 742 { 743 MHCalibrationChargePix &histlo = (MHCalibrationChargePix&)(*this)(i); 732 if (pix.IsHiGainValid()) 733 { 734 const Float_t sumhi = pix.GetExtractedSignalHiGain(); 735 if (IsOscillations()) 736 histhi.FillHistAndArray(sumhi); 737 else 738 histhi.FillHist(sumhi); 739 740 fSumhiarea[aidx] += sumhi; 741 fSumhisector[sector] += sumhi; 742 } 743 744 if (!IsLoGain()) 745 continue; 746 747 MHCalibrationChargePix &histlo = (MHCalibrationChargePix&)(*this)(i); 748 749 const Int_t satlo = pix.IsLoGainSaturated() ? 1 : 0; 750 histlo.AddSaturated(satlo); 751 if (satlo) 752 { 753 fSatloarea[aidx]++; 754 fSatlosector[sector]++; 755 } 756 757 /* 758 // Previously: 759 fSatloarea[aidx] += pix.GetNumHiGainSaturated(); 760 fSatlosector[sector] += pix.GetNumHiGainSaturated(); 761 */ 762 763 if (pix.IsLoGainValid()) 764 { 744 765 const Float_t sumlo = pix.GetExtractedSignalLoGain(); 745 const Int_t satlo = pix.IsLoGainSaturated() ? 1 : 0; 746 766 747 767 if (IsOscillations()) 748 histlo.FillHistAndArray(sumlo);768 histlo.FillHistAndArray(sumlo); 749 769 else 750 histlo.FillHist(sumlo); 751 752 histlo.AddSaturated(satlo); 753 754 fSumloarea[aidx] += sumlo; 755 fSatloarea[aidx] += satlo; 756 fSumlosector[sector] += sumlo; 757 fSatlosector[sector] += satlo; 758 } 759 760 } 770 histlo.FillHist(sumlo); 771 772 fSumloarea[aidx] += sumlo; 773 fSumlosector[sector] += sumlo; 774 } 775 } 761 776 762 777 MRawEvtPixelIter pixel(fRawEvt); 763 778 while (pixel.Next()) 764 { 765 779 { 766 780 const UInt_t pixid = pixel.GetPixelId(); 767 781 … … 791 805 fTimelosector[sector] += timelo; 792 806 } 793 807 } 794 808 795 809 for (UInt_t j=0; j<nareas; j++) … … 1125 1139 pix.SetAbsTimeRms(rms); 1126 1140 1127 const Float_t lowerlimit = (Float_t)first + fTimeLowerLimit;1128 const Float_t upperlimit = (Float_t)last - fTimeUpperLimit;1141 const Float_t lowerlimit = (Float_t)first;// + fTimeLowerLimit; 1142 const Float_t upperlimit = (Float_t)last ;// - fTimeUpperLimit; 1129 1143 1130 1144 if (mean<lowerlimit) 1131 1145 { 1132 1146 *fLog << warn << hist.GetName() << ": Mean Arr.Time: " 1133 << Form("%4.1f < %4.1f, %3.1f", mean, TMath::Floor(first)+fTimeLowerLimit, fTimeLowerLimit) 1134 << " slices below " << Form("%2i", (Int_t)first) << endl; 1135 bad.SetUncalibrated( MBadPixelsPix::kMeanTimeInFirstBin ); 1147 << Form("%4.1f < %4.1f, (%3.1f + %3.1)", mean, lowerlimit, fTimeLowerLimit, first) << endl; 1148 bad.SetUncalibrated(MBadPixelsPix::kMeanTimeInFirstBin); 1136 1149 } 1137 1150 … … 1139 1152 { 1140 1153 *fLog << warn << hist.GetName() << ": Mean Arr.Time: " 1141 << Form("%4.1f > %4.1f, %3.1f", mean, TMath::Floor(last)-fTimeUpperLimit, fTimeUpperLimit) 1142 << " slices above " << Form("%2i", (Int_t)last) << endl; 1143 bad.SetUncalibrated( MBadPixelsPix::kMeanTimeInLast2Bins ); 1154 << Form("%4.1f > %4.1f, (%3.1f - %3.1)", mean, upperlimit, fTimeUpperLimit, last) << endl; 1155 bad.SetUncalibrated(MBadPixelsPix::kMeanTimeInLast2Bins); 1144 1156 } 1145 1157 } -
trunk/MagicSoft/Mars/mhcalib/MHCalibrationPulseTimeCam.cc
r8147 r8192 1 1 /* ======================================================================== *\ 2 ! $Name: not supported by cvs2svn $:$Id: MHCalibrationPulseTimeCam.cc,v 1.25 2006-11-01 15:48:31 tbretz Exp $ 3 ! -------------------------------------------------------------------------- 2 4 ! 3 5 ! * … … 17 19 ! 18 20 ! Author(s): Markus Gaug 02/2004 <mailto:markus@ifae.es> 21 ! Author(s): Thomas Bretz <mailto:tbretz@astro.uni-wuerzburg.de> 19 22 ! 20 ! Copyright: MAGIC Software Development, 2000-200 423 ! Copyright: MAGIC Software Development, 2000-2006 21 24 ! 22 25 ! … … 427 430 } 428 431 432 if (*max > fSaturationLimit) 433 continue; 434 429 435 start = pixel.GetLoGainSamples(); 430 436 end = start + pixel.GetNumLoGainSamples(); … … 436 442 { 437 443 max = p; 438 maxpos = p-start +pixel.GetNumHiGainSamples() - 1;444 maxpos = p-start-1 + pixel.GetNumHiGainSamples(); 439 445 } 440 446 p++; … … 552 558 { 553 559 554 555 if (hist.IsEmpty() || hist.IsOnlyOverflow() || hist.IsOnlyUnderflow()) 556 { 557 *fLog << warn << GetDescriptor() << ": Only over- or underflow in " << hist.GetName() << endl; 560 if (hist.IsEmpty()) 561 { 562 *fLog << warn << hist.GetName() << ": Histogram empty." << endl; 558 563 return; 559 } 564 } 565 if (hist.IsOnlyOverflow()) 566 { 567 *fLog << warn << hist.GetName() << ": Histogram contains only overflows." << endl; 568 return; 569 } 570 if (hist.IsOnlyUnderflow()) 571 { 572 *fLog << warn << hist.GetName() << ": Histogram contains only underflows." << endl; 573 return; 574 } 560 575 561 576 hist.BypassFit(); -
trunk/MagicSoft/Mars/mhcalib/MHCalibrationRelTimeCam.cc
r8001 r8192 128 128 const Float_t MHCalibrationRelTimeCam::fgNumHiGainSaturationLimit = 0.25; 129 129 const UInt_t MHCalibrationRelTimeCam::fgReferencePixel = 1; 130 const Int_t MHCalibrationRelTimeCam::fgNbins = 300;131 const Axis_t MHCalibrationRelTimeCam::fgFirst = - 4.975;130 const Int_t MHCalibrationRelTimeCam::fgNbins = 400; 131 const Axis_t MHCalibrationRelTimeCam::fgFirst = -9.975; 132 132 const Axis_t MHCalibrationRelTimeCam::fgLast = 10.025; 133 133 const Float_t MHCalibrationRelTimeCam::fgProbLimit = 0.0; … … 324 324 fSumareahi .Reset(); 325 325 fSumarealo .Reset(); 326 fSumsectorhi.Reset(); 326 fSumsectorhi.Reset(); 327 327 fSumsectorlo.Reset(); 328 fNumareahi .Reset(); 328 fNumareahi .Reset(); 329 329 fNumarealo .Reset(); 330 fNumsectorhi.Reset(); 330 fNumsectorhi.Reset(); 331 331 fNumsectorlo.Reset(); 332 332 333 333 const MArrivalTimePix &refpix = (*arrtime)[fReferencePixel]; 334 const Float_t reftime = refpix.IsHiGainSaturated() 335 ? refpix.GetArrivalTimeLoGain() : refpix.GetArrivalTimeHiGain(); 334 // FIXME: What do we do if pixel is invalid? 335 if (!refpix.IsArrivalTimeValid()) 336 { 337 gLog << warn << "WARNING - Arrival time in refrence pixel " << fReferencePixel << " invalid." << endl; 338 return kTRUE; 339 } 340 341 const Float_t reftime = refpix.GetArrivalTime(); 342 // refpix.IsHiGainSaturated() 343 // ? refpix.GetArrivalTimeLoGain() : refpix.GetArrivalTimeHiGain(); 336 344 337 345 for (Int_t i=0; i<npixels; i++) 338 { 339 346 { 340 347 MHCalibrationPix &histhi = (*this)[i]; 341 342 348 if (histhi.IsExcluded()) 343 continue; 344 345 const MArrivalTimePix &pix = (*arrtime)[i]; 349 continue; 350 346 351 const Int_t aidx = (*fGeom)[i].GetAidx(); 347 352 const Int_t sector = (*fGeom)[i].GetSector(); 348 353 349 if (pix.IsHiGainSaturated() && IsLoGain()) 350 { 354 const MArrivalTimePix &pix = (*arrtime)[i]; 355 356 // If hi-gain arrival time has been extracted successfully 357 // fill hi-gain histograms and arrays 358 if (pix.IsHiGainValid() && !pix.IsHiGainSaturated()) 359 { 360 const Float_t time = pix.GetArrivalTimeHiGain(); 361 362 if (IsOscillations()) 363 histhi.FillHistAndArray(time-reftime); 364 else 365 histhi.FillHist(time-reftime); 366 367 fSumareahi [aidx] += time; 368 fNumareahi [aidx] ++; 369 fSumsectorhi[sector] += time; 370 fNumsectorhi[sector] ++; 371 } 372 373 if (!pix.IsHiGainSaturated()) 374 continue; 375 376 histhi.AddSaturated(1); 377 378 // If lo-gain arrival time has been extracted successfully, 379 // the hi-gain has saturateed and the lo-gain is switched on 380 // fill hi-gain histograms and arrays 381 if (pix.IsLoGainValid() && IsLoGain()) 382 { 351 383 const Float_t time = pix.GetArrivalTimeLoGain(); 352 histhi.AddSaturated(1);353 384 354 385 MHCalibrationPix &histlo = (*this)(i); 355 386 if (IsOscillations()) 356 387 histlo.FillHistAndArray(time-reftime); 357 388 else … … 362 393 fSumsectorlo[sector] += time; 363 394 fNumsectorlo[sector] ++; 364 } 365 else 366 { 367 const Float_t time = pix.GetArrivalTimeHiGain(); 368 369 if (IsOscillations()) 370 histhi.FillHistAndArray(time-reftime); 371 else 372 histhi.FillHist(time-reftime); 373 374 fSumareahi [aidx] += time; 375 fNumareahi [aidx] ++; 376 fSumsectorhi[sector] += time; 377 fNumsectorhi[sector] ++; 378 } 379 } 380 395 } 396 } 397 381 398 for (Int_t j=0; j<nareas; j++) 382 399 { … … 848 865 Int_t MHCalibrationRelTimeCam::ReadEnv(const TEnv &env, TString prefix, Bool_t print) 849 866 { 850 851 Bool_t rc = kFALSE; 852 853 if (IsEnvDefined(env, prefix, "ReferenceFile", print)) 854 { 855 SetReferenceFile(GetEnvValue(env,prefix,"ReferenceFile",fReferenceFile.Data())); 856 rc = kTRUE; 857 } 858 859 TEnv refenv(fReferenceFile); 860 861 fInnerRefTime = refenv.GetValue("InnerRefTime",fInnerRefTime); 862 fOuterRefTime = refenv.GetValue("OuterRefTime",fOuterRefTime); 863 864 return MHCalibrationCam::ReadEnv(env,prefix,print) ? kTRUE : rc; 865 866 } 867 Bool_t rc = kFALSE; 868 869 if (IsEnvDefined(env, prefix, "ReferenceFile", print)) 870 { 871 SetReferenceFile(GetEnvValue(env, prefix, "ReferenceFile", fReferenceFile.Data())); 872 rc = kTRUE; 873 } 874 875 if (IsEnvDefined(env, prefix, "ReferencePixel", print)) 876 { 877 SetReferencePixel(GetEnvValue(env, prefix, "ReferencePixel", (Int_t)fReferencePixel)); 878 rc = kTRUE; 879 } 880 881 TEnv refenv(fReferenceFile); 882 883 fInnerRefTime = refenv.GetValue("InnerRefTime", fInnerRefTime); 884 fOuterRefTime = refenv.GetValue("OuterRefTime", fOuterRefTime); 885 886 return MHCalibrationCam::ReadEnv(env,prefix,print) ? kTRUE : rc; 887 } -
trunk/MagicSoft/Mars/mhcalib/MHGausEvents.h
r8023 r8192 146 146 const Bool_t IsFourierSpectrumOK() const { return TESTBIT(fFlags,kFourierSpectrumOK); } 147 147 const Bool_t IsGausFitOK() const { return TESTBIT(fFlags,kGausFitOK); } 148 const Bool_t IsOnlyOverflow() const { return fHGausHist.GetEntries() == fHGausHist.GetBinContent(fNbins+1); }149 const Bool_t IsOnlyUnderflow() const { return fHGausHist.GetEntries() == fHGausHist.GetBinContent(0); }148 const Bool_t IsOnlyOverflow() const { return fHGausHist.GetEntries()>0 && fHGausHist.GetEntries() == fHGausHist.GetBinContent(fNbins+1); } 149 const Bool_t IsOnlyUnderflow() const { return fHGausHist.GetEntries()>0 && fHGausHist.GetEntries() == fHGausHist.GetBinContent(0); } 150 150 151 151 // Prints
Note:
See TracChangeset
for help on using the changeset viewer.