- Timestamp:
- 03/03/07 22:01:13 (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/mhcalib/MHCalibrationPulseTimeCam.cc
r8350 r8355 1 1 /* ======================================================================== *\ 2 ! $Name: not supported by cvs2svn $:$Id: MHCalibrationPulseTimeCam.cc,v 1.3 2 2007-03-01 23:43:33 tbretz Exp $2 ! $Name: not supported by cvs2svn $:$Id: MHCalibrationPulseTimeCam.cc,v 1.33 2007-03-03 22:01:13 tbretz Exp $ 3 3 ! -------------------------------------------------------------------------- 4 4 ! … … 105 105 106 106 #include <TEnv.h> 107 #include <TLine.h> 107 108 #include <TGraph.h> 108 109 #include <TLegend.h> … … 218 219 cam->fLast = fLast; 219 220 cam->fReferenceFile = fReferenceFile; 221 cam->fInnerRefTime = fInnerRefTime; 222 cam->fOuterRefTime = fOuterRefTime; 220 223 221 224 if (!IsAverageing()) … … 301 304 fHiGainArray->AddAt(new MHCalibrationPix(Form("%sHiGainPix%04d",fHistName.Data(),i), 302 305 Form("%s High Gain Pixel %4d",fHistTitle.Data(),i)),i); 303 304 MHCalibrationPix &pix = (*this)[i]; 306 307 MHCalibrationPix &pix = (*this)[i]; 305 308 pix.SetBinning(fNbins, fFirst, fLast); 306 309 307 310 MBadPixelsPix &bad = fIntensBad ? (*fIntensBad)[i] : (*fBadPixels)[i]; 308 311 InitHists(pix,bad,i); … … 322 325 fAverageHiGainAreas->AddAt(new MHCalibrationPix(Form("%sHiGainArea%d",fHistName.Data(),j), 323 326 Form("%s High Gain Area Idx %d",fHistTitle.Data(),j)),j); 324 327 325 328 MHCalibrationPix &pix = GetAverageHiGainArea(j); 326 329 pix.SetBinning(fNbins, fFirst, fLast); … … 338 341 MHCalibrationPix &pix = GetAverageHiGainSector(j); 339 342 pix.SetBinning(fNbins, fFirst, fLast); 340 343 341 344 InitHists(pix,fIntensCam ? fIntensCam->GetAverageBadSector(j) : fCam->GetAverageBadSector(j),j); 342 345 } … … 469 472 for (Int_t i=0; i<fHiGainArray->GetSize(); i++) 470 473 { 471 474 472 475 MHCalibrationPix &hist = (*this)[i]; 473 476 474 477 if (hist.IsExcluded()) 475 478 continue; 476 479 477 480 MCalibrationPix &pix = calcam[i]; 478 481 CalcHists(hist,pix); … … 481 484 if (!IsAverageing()) 482 485 return kTRUE; 483 486 484 487 for (Int_t j=0; j<fAverageHiGainAreas->GetSize(); j++) 485 488 { 486 487 489 MHCalibrationPix &hist = GetAverageHiGainArea(j); 488 490 MCalibrationPix &pix = calcam.GetAverageArea(j); 489 491 CalcHists(hist,pix); 490 }491 492 } 493 492 494 for (Int_t j=0; j<fAverageHiGainSectors->GetSize(); j++) 493 495 { … … 496 498 CalcHists(hist,pix); 497 499 } 498 500 499 501 return kTRUE; 500 502 } … … 570 572 option.ToLower(); 571 573 572 TVirtualPad *pad = gPad ? gPad : MH::MakeDefCanvas(this); 574 TVirtualPad *pad = gPad ? gPad : MH::MakeDefCanvas(this); 573 575 pad->SetBorderMode(0); 574 pad->Divide(1,nareas );576 pad->Divide(1,nareas, 1e-10, 1e-10); 575 577 576 578 // 577 579 // Loop over inner and outer pixels 578 // 579 for (Int_t i=0; i<nareas;i++) 580 // 581 for (Int_t i=0; i<nareas;i++) 580 582 { 581 582 583 pad->cd(i+1); 583 584 584 585 MHCalibrationPix &hipix = GetAverageHiGainArea(i); 585 586 DrawDataCheckPixel(hipix,i ? fOuterRefTime : fInnerRefTime); 586 }587 } 587 588 } 588 589 … … 597 598 void MHCalibrationPulseTimeCam::DrawDataCheckPixel(MHCalibrationPix &pix, const Float_t refline) 598 599 { 599 600 gPad->SetTicks(); 601 602 TH1F *hist = pix.GetHGausHist(); 603 604 TH1F *null = new TH1F("Null",hist->GetTitle(),100, 605 pix.GetFirst() > 0. ? pix.GetFirst() : 0., 606 pix.GetLast() > pix.GetFirst() 607 ? pix.GetLast() : pix.GetFirst()*2.); 608 609 null->SetMaximum(1.1*hist->GetMaximum()); 610 null->SetDirectory(NULL); 611 null->SetBit(kCanDelete); 612 null->SetStats(kFALSE); 613 // 614 // set the labels bigger 615 // 616 TAxis *xaxe = null->GetXaxis(); 617 TAxis *yaxe = null->GetYaxis(); 618 xaxe->CenterTitle(); 619 yaxe->CenterTitle(); 620 xaxe->SetTitleSize(0.06); 621 yaxe->SetTitleSize(0.076); 622 xaxe->SetTitleOffset(0.6); 623 yaxe->SetTitleOffset(0.65); 624 xaxe->SetLabelSize(0.06); 625 yaxe->SetLabelSize(0.06); 626 xaxe->SetTitle(hist->GetXaxis()->GetTitle()); 627 yaxe->SetTitle(hist->GetYaxis()->GetTitle()); 628 629 null->Draw(); 630 hist->Draw("same"); 631 632 DisplayRefLines(null,refline); 633 634 return; 635 600 gPad->SetBorderMode(0); 601 gPad->SetTicks(); 602 603 TH1F *hist = pix.GetHGausHist(); 604 605 // 606 // set the labels bigger 607 // 608 TAxis *xaxe = hist->GetXaxis(); 609 TAxis *yaxe = hist->GetYaxis(); 610 xaxe->CenterTitle(); 611 yaxe->CenterTitle(); 612 xaxe->SetTitleSize(0.06); 613 yaxe->SetTitleSize(0.076); 614 xaxe->SetTitleOffset(0.6); 615 yaxe->SetTitleOffset(0.65); 616 xaxe->SetLabelSize(0.06); 617 yaxe->SetLabelSize(0.06); 618 xaxe->SetTitle(hist->GetXaxis()->GetTitle()); 619 yaxe->SetTitle(hist->GetYaxis()->GetTitle()); 620 xaxe->SetRange(hist->GetMaximumBin()-30, hist->GetMaximumBin()+30); 621 622 hist->Draw(); 623 624 DisplayRefLines(hist, refline); 636 625 } 637 626 638 627 void MHCalibrationPulseTimeCam::DisplayRefLines(const TH1F *hist, const Float_t refline) const 639 628 { 640 641 TGraph *gr = new TGraph(2); 642 gr->SetPoint(0,refline,0.); 643 gr->SetPoint(1,refline,hist->GetMaximum()); 644 gr->SetBit(kCanDelete); 645 gr->SetLineColor(106); 646 gr->SetLineStyle(2); 647 gr->SetLineWidth(3); 648 gr->Draw("L"); 649 650 TLegend *leg = new TLegend(0.8,0.35,0.99,0.65); 651 leg->SetBit(kCanDelete); 652 leg->AddEntry(gr,"Reference","l"); 653 654 leg->Draw(); 629 TLine *line = new TLine(refline, 0, refline, hist->GetMaximum()); 630 line->SetLineColor(106); 631 line->SetLineStyle(2); 632 line->SetLineWidth(3); 633 line->SetBit(kCanDelete); 634 line->Draw(); 635 636 TLegend *leg = new TLegend(0.8,0.35,0.99,0.65); 637 leg->AddEntry(line, "Reference", "l"); 638 leg->SetBit(kCanDelete); 639 leg->Draw(); 655 640 } 656 641
Note:
See TracChangeset
for help on using the changeset viewer.