Changeset 3012 for trunk/MagicSoft/Mars/mcalib/MHCalibrationPixel.cc
- Timestamp:
- 02/03/04 20:14:48 (21 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
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());
Note:
See TracChangeset
for help on using the changeset viewer.