Changeset 3012
- Timestamp:
- 02/03/04 20:14:48 (21 years ago)
- Location:
- trunk/MagicSoft/Mars
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/Changelog
r3011 r3012 6 6 2004/02/03: Markus Gaug 7 7 8 * manalysis/M ExtractedSignalPix.[h,cc]8 * manalysis/MHExtractedSignalPix.[h,cc] 9 9 - added Thomas B. modified version of MHPedestalPixel. Later will 10 10 remove MHPedestalPixel 11 12 * manalysis/MCalibrationPix.[h,cc] 13 * manalysis/MHCalibrationPixel.[h,cc] 14 * manalysis/MCalibrationCam.cc 15 * macros/calibration.C 16 - now split completely absolute and relative times. Absolute 17 times are not fitted, but their histogram mean and rms are 18 returned. 11 19 12 20 -
trunk/MagicSoft/Mars/macros/calibration.C
r3007 r3012 50 50 read.DisableAutoScheme(); 51 51 52 MGeomApply geomapl;53 MExtractSignal sigcalc;52 MGeomApply geomapl; 53 MExtractSignal2 sigcalc; 54 54 // 55 55 // We saw that the signal jumps between slices, … … 57 57 // Sliding window will be implemented asap. 58 58 // 59 sigcalc.SetRange(1,14,1,14);59 // sigcalc.SetRange(1,14,1,14); 60 60 61 61 MPedCalcPedRun pedcalc; 62 pedcalc.SetUseHists();62 // MFillH fill("MPedestalCam", "MExtractedSignalCam"); 63 63 64 64 tlist.AddToList(&read); … … 66 66 tlist.AddToList(&sigcalc); 67 67 tlist.AddToList(&pedcalc); 68 // tlist.AddToList(&fill); 68 69 69 70 MGeomCamMagic geomcam; … … 105 106 MHCamera dispped12 (geomcam, "MPedestalPix;DeltaRmsSigma", "Rel. Diff. RMS per Slice (Calc.-Fitted)"); 106 107 MHCamera dispped14 (geomcam, "MPedestalPix;DeltaRmsSigmaError", "Rel. Diff. RMS Error per Slice (Calc.-Fitted)"); 107 108 108 dispped0.SetCamContent(pedcam, 0); 109 109 dispped0.SetCamError(pedcam, 1); … … 215 215 // faster results 216 216 // 217 // timecalc.SetStepSize(0.02);217 timecalc.SetStepSize(0.05); 218 218 219 219 // … … 305 305 "Conversion Factor (Blind Pixel Method)"); 306 306 MHCamera disp16 (geomcam, "MCalibrationPix;RSigma/Charge", "Reduced Sigma per Charge"); 307 MHCamera disp17 (geomcam, "MCalibrationPix;AbsTimeMean", "Abs. Arrival Times"); 308 MHCamera disp18 (geomcam, "MCalibrationPix;AbsTimeRms", "RMS of Arrival Times"); 307 309 308 310 disp1.SetCamContent(calcam, 0); … … 335 337 disp16.SetCamContent(calcam, 17); 336 338 339 disp17.SetCamContent(calcam, 18); 340 disp17.SetCamError(calcam, 19); 341 disp18.SetCamContent(calcam, 20); 342 disp18.SetCamError(calcam, 21); 337 343 338 344 disp1.SetYTitle("Charge [FADC counts]"); 339 345 disp3.SetYTitle("\\sigma_{Charge} [FADC counts]"); 340 346 disp5.SetYTitle("P_{Charge} [1]"); 341 disp6.SetYTitle(" Arr. Time [ns]");347 disp6.SetYTitle("Rel. Arr. Time [ns]"); 342 348 disp7.SetYTitle("\\sigma_{Time} [ns]"); 343 349 disp8.SetYTitle("P_{Time} [1]"); … … 350 356 disp15.SetYTitle("Conversion Factor [Phot/FADC Count]"); 351 357 disp16.SetYTitle("Reduced Sigma / Charge [1]"); 358 disp17.SetYTitle("Mean Abs. Time [FADC slice]"); 359 disp18.SetYTitle("RMS Abs. Time [FADC slices]"); 352 360 353 361 MStatusDisplay *d3 = new MStatusDisplay; … … 371 379 CamDraw(c2,disp5,calcam,1,1,3); 372 380 373 // Times381 // Rel. Times 374 382 TCanvas &c3 = d3->AddTab("Fitted Rel. Times"); 375 383 c3.Divide(3,3); … … 378 386 CamDraw(c3,disp7,calcam,2,3,1); 379 387 CamDraw(c3,disp8,calcam,3,3,0); 388 389 // Abs. Times 390 TCanvas &c35 = d3->AddTab("Abs. Times"); 391 c35.Divide(2,3); 392 393 CamDraw(c35,disp17,calcam,1,2,1); 394 CamDraw(c35,disp18,calcam,2,2,1); 380 395 381 396 // Pedestals -
trunk/MagicSoft/Mars/mcalib/MCalibrationCam.cc
r3007 r3012 474 474 val = -1.; 475 475 break; 476 case 18: 477 if (!(*this)[idx].IsTimeFitValid()) 478 return kFALSE; 479 val = (*this)[idx].GetAbsTimeMean(); 480 break; 481 case 19: 482 if (!(*this)[idx].IsTimeFitValid()) 483 return kFALSE; 484 val = (*this)[idx].GetAbsTimeMeanErr(); 485 break; 486 case 20: 487 if (!(*this)[idx].IsTimeFitValid()) 488 return kFALSE; 489 val = (*this)[idx].GetAbsTimeRms(); 490 break; 491 case 21: 492 if (!(*this)[idx].IsTimeFitValid()) 493 return kFALSE; 494 val = (*this)[idx].GetAbsTimeMeanErr()/TMath::Sqrt(2.); 495 break; 476 496 default: 477 497 return kFALSE; -
trunk/MagicSoft/Mars/mcalib/MCalibrationPix.cc
r3007 r3012 129 129 fTimeLastLoGain = 0 ; 130 130 131 fAbsTimeMean = -1.; 132 fAbsTimeRms = -1.; 133 131 134 fPheFFactorMethod = -1.; 132 135 fPheFFactorMethodError = -1.; … … 666 669 } 667 670 668 Float_t first;669 Float_t last;670 671 671 if (TESTBIT(fFlags,kHiGainSaturation)) 672 672 { 673 first = (Float_t)fHist->GetAbsTimeFirstLoGain(); 674 last = (Float_t)fHist->GetAbsTimeLastLoGain(); 675 676 if (first < (Float_t)fTimeFirstLoGain+1) 673 674 if (fAbsTimeMean < (Float_t)fTimeFirstLoGain+1) 677 675 { 678 676 *fLog << warn 679 677 << "WARNING: Some absolute times smaller than limit in Pixel " 680 << fPixId << " time: " << first << " Limit: " << fTimeFirstLoGain+1 << endl; 678 << fPixId << " time: " << fAbsTimeMean 679 << " Limit: " << (Float_t)fTimeFirstLoGain+1. << endl; 681 680 return kFALSE; 682 681 } 683 682 684 if ( (Float_t)fTimeLastLoGain-1 > last)683 if (fAbsTimeMean > (Float_t)fTimeLastLoGain-1) 685 684 { 686 685 *fLog << warn 687 686 << "WARNING: Some absolute times bigger than limit in Pixel " 688 << fPixId << " time: " << last << " Limit: " << fTimeLastLoGain-1 << endl; 687 << fPixId << " time: " << fAbsTimeMean 688 << " Limit: " << (Float_t)fTimeLastLoGain-1. << endl; 689 689 return kFALSE; 690 690 } … … 693 693 else 694 694 { 695 first = (Float_t)fHist->GetAbsTimeFirstHiGain(); 696 last = (Float_t)fHist->GetAbsTimeLastHiGain(); 697 698 if (first > ((Float_t)fTimeFirstHiGain+1.)) 695 696 if (fAbsTimeMean < (Float_t)fTimeFirstHiGain+1.) 699 697 { 700 698 *fLog << warn 701 699 << "WARNING: Some absolute times smaller than limit in Pixel " 702 << fPixId << " time: " << first << " Limit: " << (Float_t)fTimeFirstHiGain+1. << endl; 700 << fPixId << " time: " << fAbsTimeMean 701 << " Limit: " << (Float_t)fTimeFirstHiGain+1. << endl; 703 702 // return kFALSE; 704 703 } 705 704 706 if ( ((Float_t)fTimeLastHiGain-1.) > last)705 if (fAbsTimeMean > (Float_t)fTimeLastHiGain-1.) 707 706 { 708 707 *fLog << warn 709 708 << "WARNING: Some absolute times bigger than limit in Pixel " 710 << fPixId << " time: " << last << " Limit: " << (Float_t)fTimeLastHiGain-1. << endl; 709 << fPixId << " time: " << fAbsTimeMean 710 << " Limit: " << (Float_t)fTimeLastHiGain-1. << endl; 711 711 // return kFALSE; 712 712 } … … 766 766 { 767 767 768 768 769 if(!fHist->FitTime()) 769 770 { … … 777 778 fTimeProb = fHist->GetRelTimeProb(); 778 779 780 fAbsTimeMean = fHist->GetAbsTimeMean(); 781 fAbsTimeMeanErr = fHist->GetAbsTimeMeanErr(); 782 fAbsTimeRms = fHist->GetAbsTimeRms(); 783 779 784 if (CheckTimeFitValidity()) 780 785 SETBIT(fFlags,kTimeFitValid); -
trunk/MagicSoft/Mars/mcalib/MCalibrationPix.h
r3007 r3012 42 42 Float_t fTimeProb; // The probability of the fit function 43 43 44 Float_t fAbsTimeMean; 45 Float_t fAbsTimeMeanErr; 46 Float_t fAbsTimeRms; 47 44 48 Byte_t fTimeFirstHiGain; // The first used FADC slice 45 49 Byte_t fTimeLastHiGain; // The last used FADC slice … … 100 104 Float_t GetErrTime() const { return fErrTime; } 101 105 Float_t GetSigmaTime() const { return fSigmaTime; } 102 Float_t GetTimeProb() const { return fTimeProb; }106 Float_t GetTimeProb() const { return fTimeProb; } 103 107 108 Float_t GetAbsTimeMean() const { return fAbsTimeMean; } 109 Float_t GetAbsTimeMeanErr() const { return fAbsTimeMeanErr; } 110 Float_t GetAbsTimeRms() const { return fAbsTimeRms; } 111 112 // Conversion Factors 104 113 Float_t GetConversionHiLo() const { return fConversionHiLo; } 105 114 Float_t GetConversionHiLoError() const { return fConversionHiLoError; } -
trunk/MagicSoft/Mars/mcalib/MHCalibrationPixel.cc
r3007 r3012 53 53 const Int_t MHCalibrationPixel::fChargeNbinsLoGain = 1010; 54 54 const Int_t MHCalibrationPixel::fAbsTimeNbins = 32; 55 const Int_t MHCalibrationPixel::fRelTimeNbins = 240;55 const Int_t MHCalibrationPixel::fRelTimeNbins = 480; 56 56 const Int_t MHCalibrationPixel::fChargevsNbins = 5000; 57 57 const Axis_t MHCalibrationPixel::fAbsTimeFirst = - 0.25; … … 59 59 const Axis_t MHCalibrationPixel::fRelTimeFirst = -11.; 60 60 const Axis_t MHCalibrationPixel::fRelTimeLast = 12.; 61 const Float_t MHCalibrationPixel::fProbLimit = 0.001; 61 62 62 63 // -------------------------------------------------------------------------- … … 205 206 fAbsTimeLastLoGain = -1.; 206 207 208 fAbsTimeMean = -1.; 209 fAbsTimeMeanErr = -1.; 210 fAbsTimeRms = -1.; 207 211 208 212 fOffset = 0.; … … 324 328 // Names Hi gain Histograms 325 329 // 326 TString nameQHiGain = TString(fHChargeHiGain->GetName()); 327 nameQHiGain += id; 328 fHChargeHiGain->SetName(nameQHiGain.Data()); 329 330 TString nameTAHiGain = TString(fHAbsTimeHiGain->GetName()); 331 nameTAHiGain += id; 332 fHAbsTimeHiGain->SetName(nameTAHiGain.Data()); 333 334 TString nameTRHiGain = TString(fHRelTimeHiGain->GetName()); 335 nameTRHiGain += id; 336 fHRelTimeHiGain->SetName(nameTRHiGain.Data()); 337 338 TString nameQvsNHiGain = TString(fHChargevsNHiGain->GetName()); 339 nameQvsNHiGain += id; 340 fHChargevsNHiGain->SetName(nameQvsNHiGain.Data()); 330 fHChargeHiGain->SetName( Form("%s%d",fHChargeHiGain->GetName(), id)); 331 fHAbsTimeHiGain->SetName( Form("%s%d",fHAbsTimeHiGain->GetName(), id)); 332 fHRelTimeHiGain->SetName( Form("%s%d",fHRelTimeHiGain->GetName(), id)); 333 fHChargevsNHiGain->SetName(Form("%s%d",fHChargevsNHiGain->GetName(),id)); 341 334 342 335 // 343 336 // Title Hi gain Histograms 344 337 // 345 TString titleQHiGain = TString(fHChargeHiGain->GetTitle()); 346 titleQHiGain += id; 347 fHChargeHiGain->SetTitle(titleQHiGain.Data()); 348 349 TString titleTAHiGain = TString(fHAbsTimeHiGain->GetTitle()); 350 titleTAHiGain += id; 351 fHAbsTimeHiGain->SetTitle(titleTAHiGain.Data()); 352 353 TString titleTRHiGain = TString(fHRelTimeHiGain->GetTitle()); 354 titleTRHiGain += id; 355 fHRelTimeHiGain->SetTitle(titleTRHiGain.Data()); 356 357 TString titleQvsNHiGain = TString(fHChargevsNHiGain->GetTitle()); 358 titleQvsNHiGain += id; 359 fHChargevsNHiGain->SetTitle(titleQvsNHiGain.Data()); 338 fHChargeHiGain->SetTitle( Form("%s%d",fHChargeHiGain->GetTitle(), id)); 339 fHAbsTimeHiGain->SetTitle( Form("%s%d",fHAbsTimeHiGain->GetTitle(), id)); 340 fHRelTimeHiGain->SetTitle( Form("%s%d",fHRelTimeHiGain->GetTitle(), id)); 341 fHChargevsNHiGain->SetTitle( Form("%s%d",fHChargevsNHiGain->GetTitle(),id)); 360 342 361 343 // 362 344 // Names Low Gain Histograms 363 345 // 364 TString nameQLoGain = TString(fHChargeLoGain->GetName()); 365 nameQLoGain += id; 366 fHChargeLoGain->SetName(nameQLoGain.Data()); 367 368 TString nameTALoGain = TString(fHAbsTimeLoGain->GetName()); 369 nameTALoGain += id; 370 fHAbsTimeLoGain->SetName(nameTALoGain.Data()); 371 372 TString nameTRLoGain = TString(fHRelTimeLoGain->GetName()); 373 nameTRLoGain += id; 374 fHRelTimeLoGain->SetName(nameTRLoGain.Data()); 375 376 TString nameQvsNLoGain = TString(fHChargevsNLoGain->GetName()); 377 nameQvsNLoGain += id; 378 fHChargevsNLoGain->SetName(nameQvsNLoGain.Data()); 346 fHChargeLoGain->SetName( Form("%s%d",fHChargeLoGain->GetName(),id)); 347 fHAbsTimeLoGain->SetName( Form("%s%d",fHAbsTimeLoGain->GetName(),id)); 348 fHRelTimeLoGain->SetName( Form("%s%d",fHRelTimeLoGain->GetName(),id)); 349 fHChargevsNLoGain->SetName( Form("%s%d",fHChargevsNLoGain->GetName(),id)); 379 350 380 351 // 381 352 // Titles Low Gain Histograms 382 353 // 383 TString titleQLoGain = TString(fHChargeLoGain->GetTitle()); 384 titleQLoGain += id; 385 fHChargeLoGain->SetTitle(titleQLoGain.Data()); 386 387 TString titleTALoGain = TString(fHAbsTimeLoGain->GetTitle()); 388 titleTALoGain += id; 389 fHAbsTimeLoGain->SetTitle(titleTALoGain.Data()); 390 391 TString titleTRLoGain = TString(fHRelTimeLoGain->GetTitle()); 392 titleTRLoGain += id; 393 fHRelTimeLoGain->SetTitle(titleTRLoGain.Data()); 394 395 TString titleQvsNLoGain = TString(fHChargevsNLoGain->GetTitle()); 396 titleQvsNLoGain += id; 397 fHChargevsNLoGain->SetTitle(titleQvsNLoGain.Data()); 354 fHChargeLoGain->SetTitle( Form("%s%d",fHChargeLoGain->GetTitle(),id)); 355 fHAbsTimeLoGain->SetTitle( Form("%s%d",fHAbsTimeLoGain->GetTitle(),id)); 356 fHRelTimeLoGain->SetTitle( Form("%s%d",fHRelTimeLoGain->GetTitle(),id)); 357 fHChargevsNLoGain->SetTitle( Form("%s%d",fHChargevsNLoGain->GetTitle(),id)); 398 358 } 399 359 … … 528 488 gROOT->SetSelectedPad(NULL); 529 489 530 TCanvas *c = M akeDefCanvas(this,600,900);490 TCanvas *c = MH::MakeDefCanvas(this,600,900); 531 491 532 492 c->Divide(2,5); … … 537 497 538 498 if (fHChargeHiGain->Integral() > 0) 539 gPad->SetLogy(1); 540 else 541 gPad->SetLogy(0); 499 gPad->SetLogy(); 542 500 543 501 fHChargeHiGain->Draw(opt); … … 553 511 554 512 if (fHChargeLoGain->Integral() > 0) 555 gPad->SetLogy(1); 556 else 557 gPad->SetLogy(0); 513 gPad->SetLogy(); 558 514 559 515 fHChargeLoGain->Draw(opt); … … 561 517 if (fChargeGausFit) 562 518 { 563 if (IsChargeFitOK()) 564 fChargeGausFit->SetLineColor(kGreen); 565 else 566 fChargeGausFit->SetLineColor(kRed); 567 519 fChargeGausFit->SetLineColor(IsChargeFitOK() ? kGreen : kRed); 568 520 fChargeGausFit->Draw("same"); 569 521 } 522 570 523 c->Modified(); 571 524 c->Update(); … … 587 540 if (fChargeGausFit) 588 541 { 589 if (IsChargeFitOK()) 590 fChargeGausFit->SetLineColor(kGreen); 591 else 592 fChargeGausFit->SetLineColor(kRed); 593 542 fChargeGausFit->SetLineColor(IsChargeFitOK() ? kGreen : kRed); 594 543 fChargeGausFit->Draw("same"); 595 544 } … … 600 549 if (fHChargeLoGain->Integral() > 0) 601 550 gPad->SetLogy(1); 602 else603 gPad->SetLogy(0);604 551 605 552 fHChargeLoGain->Draw(opt); … … 644 591 if (fRelTimeGausFit) 645 592 { 646 if (fRelTimeChisquare > 20.) 647 fRelTimeGausFit->SetLineColor(kRed); 648 else 649 fRelTimeGausFit->SetLineColor(kGreen); 650 593 fRelTimeGausFit->SetLineColor(IsTimeFitOK() ? kGreen : kRed); 651 594 fRelTimeGausFit->Draw("same"); 652 c->Modified();653 c->Update();654 595 } 596 597 c->Modified(); 598 c->Update(); 655 599 } 656 600 else … … 658 602 if (fRelTimeGausFit) 659 603 { 660 if (fRelTimeChisquare > 20.) 661 fRelTimeGausFit->SetLineColor(kRed); 662 else 663 fRelTimeGausFit->SetLineColor(kGreen); 664 604 fRelTimeGausFit->SetLineColor(IsTimeFitOK() ? kGreen : kRed); 665 605 fRelTimeGausFit->Draw("same"); 666 c->Modified();667 c->Update();668 606 } 669 670 c->cd(6); 607 608 c->Modified(); 609 c->Update(); 610 611 c->cd(6); 671 612 gPad->SetTicks(); 672 613 gPad->SetLogy(0); … … 747 688 748 689 // 690 // From the absolute time, we only take the mean and RMS 691 // 692 fAbsTimeMean = (Float_t)fHAbsTimeHiGain->GetMean(); 693 fAbsTimeRms = (Float_t)fHAbsTimeHiGain->GetRMS(); 694 fAbsTimeMeanErr = (Float_t)fAbsTimeRms / TMath::Sqrt(fHAbsTimeHiGain->GetEntries()); 695 696 if (TESTBIT(fFlags,kUseLoGain)) 697 { 698 fAbsTimeMean = fHAbsTimeLoGain->GetMean(); 699 fAbsTimeRms = fHAbsTimeLoGain->GetRMS(); 700 fAbsTimeMeanErr = fAbsTimeRms / TMath::Sqrt(fHAbsTimeLoGain->GetEntries()); 701 } 702 703 // 749 704 // Get the fitting ranges 750 705 // 751 706 Axis_t rmin = fRelTimeLowerFitRangeHiGain; 707 Axis_t rmax = fRelTimeUpperFitRangeHiGain; 708 TH1F *hist = fHRelTimeHiGain; 709 752 710 if (TESTBIT(fFlags,kUseLoGain)) 753 rmin = fRelTimeLowerFitRangeLoGain; 754 755 Axis_t rmax = fRelTimeUpperFitRangeHiGain; 756 if (TESTBIT(fFlags,kUseLoGain)) 757 rmin = fRelTimeUpperFitRangeLoGain; 758 759 TH1F *hist = fHRelTimeHiGain; 760 if (TESTBIT(fFlags,kUseLoGain)) 761 hist = fHRelTimeLoGain; 762 711 { 712 rmin = fRelTimeLowerFitRangeLoGain; 713 rmax = fRelTimeUpperFitRangeLoGain; 714 hist = fHRelTimeLoGain; 715 } 716 763 717 const Stat_t entries = hist->Integral("width"); 764 718 const Double_t mu_guess = hist->GetBinCenter(hist->GetMaximumBin()); -
trunk/MagicSoft/Mars/mcalib/MHCalibrationPixel.h
r3007 r3012 27 27 static const Axis_t fRelTimeFirst; 28 28 static const Axis_t fRelTimeLast; 29 29 static const Float_t fProbLimit; 30 30 31 Int_t fPixId; // Pixel Nr 31 32 … … 80 81 Double_t fRelTimeSigma; 81 82 82 Float_t fRelTimeLowerFitRangeHiGain; 83 Float_t fRelTimeUpperFitRangeHiGain; 84 Float_t fRelTimeLowerFitRangeLoGain; 85 Float_t fRelTimeUpperFitRangeLoGain; 86 87 Float_t fAbsTimeFirstHiGain; 88 Float_t fAbsTimeFirstLoGain; 89 Float_t fAbsTimeLastHiGain; 90 Float_t fAbsTimeLastLoGain; 91 92 Byte_t fFlags; 93 94 enum { kUseLoGain, kChargeFitOK, kTimeFitOK }; 83 Float_t fAbsTimeMean; 84 Float_t fAbsTimeMeanErr; 85 Float_t fAbsTimeRms; 86 87 Float_t fRelTimeLowerFitRangeHiGain; 88 Float_t fRelTimeUpperFitRangeHiGain; 89 Float_t fRelTimeLowerFitRangeLoGain; 90 Float_t fRelTimeUpperFitRangeLoGain; 91 92 Float_t fAbsTimeFirstHiGain; 93 Float_t fAbsTimeFirstLoGain; 94 Float_t fAbsTimeLastHiGain; 95 Float_t fAbsTimeLastLoGain; 96 97 Byte_t fFlags; 98 99 enum { kUseLoGain, kChargeFitOK, kTimeFitOK }; 95 100 96 101 virtual void DrawLegend(); … … 130 135 const Int_t GetRelTimeNdf() const { return fRelTimeNdf; } 131 136 137 138 const Float_t GetAbsTimeMean() const { return fAbsTimeMean; } 139 const Float_t GetAbsTimeMeanErr() const { return fAbsTimeMeanErr; } 140 const Float_t GetAbsTimeRms() const { return fAbsTimeRms; } 141 132 142 const TH1F *GetHCharge() { return fHChargeHiGain; } 133 143 const TH1F *GetHCharge() const { return fHChargeHiGain; }
Note:
See TracChangeset
for help on using the changeset viewer.