Changeset 2699 for trunk/MagicSoft/Mars/mhist
- Timestamp:
- 12/17/03 18:41:32 (21 years ago)
- Location:
- trunk/MagicSoft/Mars/mhist
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/mhist/MHCalibrationBlindPixel.cc
r2641 r2699 82 82 fHBlindPixelCharge->SetXTitle("Sum FADC Slices"); 83 83 fHBlindPixelCharge->SetYTitle("Nr. of events"); 84 // fHBlindPixelCharge->Sumw2(); 85 86 fErrBlindPixelChargefirst = 0.; 87 fErrBlindPixelChargelast = gkStartBlindPixelBinNr; 88 fErrBlindPixelChargenbins = gkStartBlindPixelBinNr; 89 90 fHBlindPixelErrCharge = new TH1F("HBlindPixelErrCharge","Distribution of Variances of Summed FADC Slices", 91 fErrBlindPixelChargenbins,fErrBlindPixelChargefirst,fErrBlindPixelChargelast); 92 fHBlindPixelErrCharge->SetXTitle("Variance Summed FADC Slices"); 93 fHBlindPixelErrCharge->SetYTitle("Nr. of events"); 94 fHBlindPixelErrCharge->Sumw2(); 84 fHBlindPixelCharge->Sumw2(); 95 85 96 86 Axis_t tfirst = -0.5; … … 121 111 delete fHBlindPixelCharge; 122 112 delete fHBlindPixelTime; 123 delete fHBlindPixelErrCharge; 124 113 125 114 if (fSinglePheFit) 126 115 delete fSinglePheFit; … … 136 125 { 137 126 fHBlindPixelCharge->SetBinContent (i, 1.e-20); 138 fHBlindPixelErrCharge->SetBinContent (i, 1.e-20);139 127 fHBlindPixelTime->SetBinContent(i, 1.e-20); 140 128 } … … 279 267 gRandom->SetSeed(); 280 268 281 if (fHBlindPixelCharge->Get Entries() != 0)269 if (fHBlindPixelCharge->GetIntegral() != 0) 282 270 { 283 271 *fLog << err << "Histogram " << fHBlindPixelCharge->GetTitle() << " is already filled. " << endl; … … 329 317 // otherwise the fit goes gaga because of high number of dimensions ... 330 318 // 331 const Stat_t entries = fHBlindPixelCharge-> GetEntries();319 const Stat_t entries = fHBlindPixelCharge->Integral(); 332 320 const Double_t lambda_guess = 0.5; 333 321 const Double_t mu_0_guess = fHBlindPixelCharge->GetBinCenter(fHBlindPixelCharge->GetMaximumBin()); … … 439 427 Int_t nbins = 50; 440 428 441 *fLog << "New number of bins in HSinCharge: " << CutEdges(fHBlindPixelCharge,nbins) << endl;429 CutEdges(fHBlindPixelCharge,nbins); 442 430 443 431 fBlindPixelChargefirst = fHBlindPixelCharge->GetBinLowEdge(fHBlindPixelCharge->GetXaxis()->GetFirst()); … … 445 433 fBlindPixelChargenbins = nbins; 446 434 447 *fLog << "New number of bins in HErrCharge: " << CutEdges(fHBlindPixelErrCharge,30) << endl;448 fErrBlindPixelChargefirst = fHBlindPixelErrCharge->GetBinLowEdge(fHBlindPixelErrCharge->GetXaxis()->GetFirst());449 fErrBlindPixelChargelast = fHBlindPixelErrCharge->GetBinLowEdge(fHBlindPixelErrCharge->GetXaxis()->GetLast())+fHBlindPixelErrCharge->GetBinWidth(0);450 fErrBlindPixelChargenbins = nbins;451 452 435 CutEdges(fHBlindPixelChargevsN,0); 453 436 … … 463 446 rmax = (rmax != 0.) ? rmax : 9.; 464 447 465 const Stat_t entries = fHBlindPixelTime-> GetEntries();448 const Stat_t entries = fHBlindPixelTime->Integral(); 466 449 const Double_t mu_guess = fHBlindPixelTime->GetBinCenter(fHBlindPixelTime->GetMaximumBin()); 467 450 const Double_t sigma_guess = (rmax - rmin)/2.; -
trunk/MagicSoft/Mars/mhist/MHCalibrationBlindPixel.h
r2642 r2699 33 33 34 34 TH1F* fHBlindPixelCharge; //-> Histogram with the single Phe spectrum 35 TH1F* fHBlindPixelErrCharge; //-> Variance of summed FADC slices 36 TH1I* fHBlindPixelTime; //-> Variance of summed FADC slices 35 TH1I* fHBlindPixelTime; //-> Variance of summed FADC slices 37 36 TH1I* fHBlindPixelChargevsN; //-> Summed Charge vs. Event Nr. 38 37 … … 45 44 Int_t fBlindPixelChargenbins; 46 45 47 Axis_t fErrBlindPixelChargefirst;48 Axis_t fErrBlindPixelChargelast;49 Int_t fErrBlindPixelChargenbins;50 51 46 void ResetBin(Int_t i); 52 47 void DrawLegend(); … … 88 83 89 84 Bool_t FillBlindPixelCharge(Float_t q) { return fHBlindPixelCharge->Fill(q) > -1; } 90 Bool_t FillErrBlindPixelCharge(Float_t errq) { return fHBlindPixelErrCharge->Fill(errq) > -1; }91 85 Bool_t FillBlindPixelTime(Int_t t) { return fHBlindPixelTime->Fill(t) > -1; } 92 86 Bool_t FillBlindPixelChargevsN(Stat_t rq, Int_t t) { return fHBlindPixelChargevsN->Fill(t,rq) > -1; } … … 115 109 const Double_t GetSigmaTimeErr() const { return fSigmaTimeErr; } 116 110 117 const TH1F *GetHErrCharge() { return fHBlindPixelErrCharge; }118 const TH1F *GetHErrCharge() const { return fHBlindPixelErrCharge; }119 120 111 Bool_t SimulateSinglePhe(Double_t lambda, 121 112 Double_t mu0, -
trunk/MagicSoft/Mars/mhist/MHCalibrationPixel.cc
r2666 r2699 297 297 { 298 298 299 if (fHChargeHiGain-> GetEntries() > fHChargeLoGain->GetEntries())299 if (fHChargeHiGain->Integral() > fHChargeLoGain->Integral()) 300 300 { 301 301 fUseLoGain = kFALSE; … … 382 382 FitHiGainvsLoGain(); 383 383 384 385 384 gStyle->SetOptFit(0); 386 385 gStyle->SetOptStat(1111111); … … 390 389 gROOT->SetSelectedPad(NULL); 391 390 392 c->Divide(2,4); 393 394 c->cd(1); 395 gPad->SetBorderMode(0); 391 c->Divide(2,4); 392 393 c->cd(1); 394 gPad->SetBorderMode(0); 395 gPad->SetTicks(); 396 397 if (fHChargeHiGain->Integral() > 0) 396 398 gPad->SetLogy(1); 397 gPad->SetTicks(); 398 399 fHChargeHiGain->DrawCopy(opt); 400 401 c->Modified(); 402 c->Update(); 403 404 if (fUseLoGain) 399 else 400 gPad->SetLogy(0); 401 402 fHChargeHiGain->DrawCopy(opt); 403 404 c->Modified(); 405 c->Update(); 406 407 if (fUseLoGain) 408 { 409 410 c->cd(2); 411 gPad->SetTicks(); 412 413 if (fHChargeLoGain->Integral() > 0) 414 gPad->SetLogy(1); 415 else 416 gPad->SetLogy(0); 417 418 fHChargeLoGain->DrawCopy(opt); 419 420 if (fChargeGausFit) 421 { 422 if (fFitOK) 423 fChargeGausFit->SetLineColor(kGreen); 424 else 425 fChargeGausFit->SetLineColor(kRed); 426 427 fChargeGausFit->DrawCopy("same"); 428 } 429 c->Modified(); 430 c->Update(); 431 432 c->cd(3); 433 gROOT->SetSelectedPad(NULL); 434 gStyle->SetOptFit(); 435 fHivsLoGain->Draw("prof"); 436 437 gPad->Modified(); 438 gPad->Update(); 439 440 c->cd(4); 441 DrawLegend(); 442 443 } 444 else 445 { 446 if (fChargeGausFit) 447 { 448 if (fFitOK) 449 fChargeGausFit->SetLineColor(kGreen); 450 else 451 fChargeGausFit->SetLineColor(kRed); 452 453 fChargeGausFit->DrawCopy("same"); 454 } 455 456 c->cd(2); 457 gPad->SetTicks(); 458 459 if (fHChargeLoGain->Integral() > 0) 460 gPad->SetLogy(1); 461 else 462 gPad->SetLogy(0); 463 464 fHChargeLoGain->DrawCopy(opt); 465 c->Modified(); 466 c->Update(); 467 468 c->cd(3); 469 DrawLegend(); 470 471 c->cd(4); 472 473 gROOT->SetSelectedPad(NULL); 474 gStyle->SetOptFit(); 475 fHivsLoGain->Draw("prof"); 476 gPad->Modified(); 477 gPad->Update(); 478 } 479 480 c->Modified(); 481 c->Update(); 482 483 c->cd(5); 484 gStyle->SetOptStat(1111111); 485 486 gPad->SetTicks(); 487 gPad->SetLogy(0); 488 fHTimeHiGain->DrawCopy(opt); 489 c->Modified(); 490 c->Update(); 491 492 if (fUseLoGain) 405 493 { 406 c->cd(2); 407 gPad->SetLogy(1); 408 gPad->SetTicks(); 409 fHChargeLoGain->DrawCopy(opt); 410 411 if (fChargeGausFit) 412 { 413 if (fFitOK) 414 fChargeGausFit->SetLineColor(kGreen); 415 else 416 fChargeGausFit->SetLineColor(kRed); 417 418 fChargeGausFit->DrawCopy("same"); 419 } 420 c->Modified(); 421 c->Update(); 422 423 c->cd(3); 424 gROOT->SetSelectedPad(NULL); 425 gStyle->SetOptFit(); 426 fHivsLoGain->Draw("prof"); 427 428 429 gPad->Modified(); 430 gPad->Update(); 431 432 c->cd(4); 433 DrawLegend(); 434 435 } 436 else 437 { 438 if (fChargeGausFit) 439 { 440 if (fFitOK) 441 fChargeGausFit->SetLineColor(kGreen); 442 else 443 fChargeGausFit->SetLineColor(kRed); 444 445 fChargeGausFit->DrawCopy("same"); 446 } 447 c->cd(2); 448 gPad->SetLogy(1); 449 gPad->SetTicks(); 450 451 fHChargeLoGain->DrawCopy(opt); 452 c->Modified(); 453 c->Update(); 454 455 c->cd(3); 456 DrawLegend(); 457 458 c->cd(4); 459 460 gROOT->SetSelectedPad(NULL); 461 gStyle->SetOptFit(); 462 fHivsLoGain->Draw("prof"); 463 gPad->Modified(); 464 gPad->Update(); 465 466 467 } 468 469 c->Modified(); 470 c->Update(); 471 472 c->cd(5); 473 gStyle->SetOptStat(1111111); 474 475 gPad->SetLogy(1); 476 fHTimeHiGain->DrawCopy(opt); 477 c->Modified(); 478 c->Update(); 479 480 if (fUseLoGain) 481 { 482 494 483 495 c->cd(6); 484 gPad->SetLogy(1); 496 gPad->SetTicks(); 497 gPad->SetLogy(0); 485 498 fHTimeLoGain->DrawCopy(opt); 486 499 c->Modified(); … … 514 527 515 528 c->cd(6); 516 gPad->SetLogy(1); 529 gPad->SetTicks(); 530 gPad->SetLogy(0); 517 531 fHTimeLoGain->DrawCopy(opt); 518 532 c->Modified(); … … 524 538 525 539 c->cd(7); 540 gPad->SetTicks(); 526 541 fHChargevsNHiGain->DrawCopy(opt); 527 542 c->Modified(); … … 529 544 530 545 c->cd(8); 546 gPad->SetTicks(); 531 547 fHChargevsNLoGain->DrawCopy(opt); 532 548 c->Modified(); … … 573 589 rmax = (rmax != 0.) ? rmax : 9.; 574 590 575 const Stat_t entries = fHTimeHiGain->GetEntries();591 const Stat_t entries = fHTimeHiGain->Integral(); 576 592 const Double_t mu_guess = fHTimeHiGain->GetBinCenter(fHTimeHiGain->GetMaximumBin()); 577 593 const Double_t sigma_guess = (rmax - rmin)/2.; … … 629 645 rmax = (rmax != 0.) ? rmax : 9.; 630 646 631 const Stat_t entries = fHTimeLoGain-> GetEntries();647 const Stat_t entries = fHTimeLoGain->Integral(); 632 648 const Double_t mu_guess = fHTimeLoGain->GetBinCenter(fHTimeLoGain->GetMaximumBin()); 633 649 const Double_t sigma_guess = (rmax - rmin)/2.; … … 692 708 // otherwise the fit goes gaga because of high number of dimensions ... 693 709 // 694 const Stat_t entries = fHChargeHiGain-> GetEntries();710 const Stat_t entries = fHChargeHiGain->Integral(); 695 711 const Double_t area_guess = entries/gkSq2Pi; 696 712 const Double_t mu_guess = fHChargeHiGain->GetBinCenter(fHChargeHiGain->GetMaximumBin()); … … 766 782 // otherwise the fit goes gaga because of high number of dimensions ... 767 783 // 768 const Stat_t entries = fHChargeLoGain-> GetEntries();784 const Stat_t entries = fHChargeLoGain->Integral(); 769 785 const Double_t area_guess = entries/gkSq2Pi; 770 786 const Double_t mu_guess = fHChargeLoGain->GetBinCenter(fHChargeLoGain->GetMaximumBin()); -
trunk/MagicSoft/Mars/mhist/MHCalibrationPixel.h
r2662 r2699 156 156 virtual void Reset(); 157 157 158 void SetLowerFitRange(Axis_t min) {fLowerFitRange = min; }158 void SetLowerFitRange(Axis_t min) { fLowerFitRange = min; } 159 159 160 160 void PrintChargeFitResult(); 161 161 void PrintTimeFitResult(); 162 162 163 Bool_t IsFitOK() { return fFitOK;}163 Bool_t IsFitOK() { return fFitOK; } 164 164 165 165 ClassDef(MHCalibrationPixel, 1)
Note:
See TracChangeset
for help on using the changeset viewer.