Changeset 13603 for fact/tools/rootmacros/PulseTemplates
- Timestamp:
- 05/08/12 17:42:39 (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
fact/tools/rootmacros/PulseTemplates/pixel.C
r13597 r13603 34 34 hPixelMedian = new TH1F*[mMaxPulseOrder]; 35 35 hPixelMean = new TH1F*[mMaxPulseOrder]; 36 37 hPixelEdgeMax = new TH1F*[mMaxPulseOrder]; 38 hPixelEdgeMedian = new TH1F*[mMaxPulseOrder]; 39 hPixelEdgeMean = new TH1F*[mMaxPulseOrder]; 36 40 37 41 hList = new TObjArray; … … 381 385 //---------------------------------------------------------------------------- 382 386 387 void 388 Pixel::BookEdgeTemplateHistos() 389 { 390 if (mVerbosityLevel > 2) cout << endl << "...book pixel histograms" << endl; 391 for (int order = 0; order < mMaxPulseOrder; order++) 392 { 393 if (mVerbosityLevel > 3) cout << "\t...booking " << HistoName("hPixelEdgeMax", order) << endl; 394 hPixelEdgeMax[order]=new TH1F( 395 HistoName("hPixelEdgeMax", order), 396 HistoTitle("Maximum value of each slice in overlay plot of", order), 397 mPixelOverlayXaxisLeft + mPixelOverlayXaxisRight , 398 (-1*mPixelOverlayXaxisLeft)-0.5, 399 mPixelOverlayXaxisRight-0.5 400 ); 401 402 hPixelEdgeMax[order]->SetAxisRange( 403 mBSLMean - 5, 404 (mGainMean*(order+1)) + 10, 405 "Y"); 406 hPixelEdgeMax[order]->GetXaxis()->SetTitle( "Timeslices [a.u.]" ); 407 hPixelEdgeMax[order]->GetYaxis()->SetTitle( "Amplitude [mV]" ); 408 //hMaxProfile->SetBit(TH2F::kCanRebin); 409 hPixelEdgeMax[order]->SetStats(mStats); 410 hList->Add( hPixelEdgeMax[order] ); 411 412 //------------------------------------------------------------------------ 413 414 if (mVerbosityLevel > 3) cout << "\t...booking " << HistoName("hPixelEdgeMean", order) << endl; 415 hPixelEdgeMean[order] = new TH1F( 416 HistoName("hPixelEdgeMean", order), 417 HistoTitle("Mean value of each slice in overlay plot of", order), 418 mPixelOverlayXaxisLeft + mPixelOverlayXaxisRight , 419 (-1*mPixelOverlayXaxisLeft)-0.5, 420 mPixelOverlayXaxisRight-0.5 421 ); 422 hPixelEdgeMean[order]->SetLineColor(kBlue); 423 hPixelEdgeMean[order]->SetAxisRange( 424 mBSLMean - 5, 425 (mGainMean*(order+1)) + 10, 426 "Y"); 427 hPixelEdgeMean[order]->GetXaxis()->SetTitle( "Timeslices [a.u.]" ); 428 hPixelEdgeMean[order]->GetYaxis()->SetTitle( "Amplitude [mV]" ); 429 hPixelEdgeMean[order]->SetStats(mStats); 430 hList->Add( hPixelEdgeMean[order] ); 431 432 //------------------------------------------------------------------------ 433 434 if (mVerbosityLevel > 3) cout << "\t...booking " << HistoName("hPixelEdgeMedian", order) << endl; 435 hPixelEdgeMedian[order] = new TH1F( 436 HistoName("hPixelEdgeMedian", order), 437 HistoTitle("Median value of each slice in overlay plot of", order), 438 mPixelOverlayXaxisLeft + mPixelOverlayXaxisRight ,//nbinsx 439 (-1*mPixelOverlayXaxisLeft)-0.5, //xlow 440 mPixelOverlayXaxisRight-0.5 //xup 441 ); 442 hPixelEdgeMedian[order]->SetLineColor(kRed); 443 hPixelEdgeMedian[order]->SetAxisRange( 444 mBSLMean - 5, 445 (mGainMean*(order+1)) + 10, 446 "Y"); 447 hPixelEdgeMedian[order]->GetXaxis()->SetTitle( "Timeslices [a.u.]" ); 448 hPixelEdgeMedian[order]->GetYaxis()->SetTitle( "Amplitude [mV]" ); 449 //hMaxProfile->SetBit(TH2F::kCanRebin); 450 hPixelEdgeMedian[order]->SetStats(mStats); 451 hList->Add( hPixelEdgeMedian[order] ); 452 453 } 454 if (mVerbosityLevel > 2) cout << "...done" << endl; 455 } 456 //end of BookEdgeTemplateHistos 457 //---------------------------------------------------------------------------- 458 383 459 384 460 void … … 461 537 pixelCanvas[pulse_order]->cd( histoFrameNr[2] ); 462 538 hPixelMean[pulse_order]->Draw(); 539 540 } 541 } 542 // end of DrawTemplateHistograms 543 //---------------------------------------------------------------------------- 544 545 void 546 Pixel::DrawEdgeTemplateHistograms( 547 TCanvas** pixelCanvas, 548 int* histoFrameNr 549 ) 550 { 551 if (mVerbosityLevel > 2) cout << endl << "...drawing Template histograms" ; 552 for (int pulse_order = 0; pulse_order < mMaxPulseOrder; pulse_order++) 553 { 554 pixelCanvas[pulse_order]->cd( histoFrameNr[0] ); 555 hPixelEdgeMax[pulse_order]->Draw(); 556 557 pixelCanvas[pulse_order]->cd( histoFrameNr[1] ); 558 hPixelEdgeMedian[pulse_order]->Draw(); 559 560 pixelCanvas[pulse_order]->cd( histoFrameNr[2] ); 561 hPixelEdgeMean[pulse_order]->Draw(); 463 562 464 563 } … … 551 650 << "\t\t...deleting hRisingEdgeToMax" 552 651 << mChid << "_" << order ; 553 //delete hRisingEdgeToMax[order];652 delete hRisingEdgeToMax[order]; 554 653 } 555 654 … … 560 659 << mChid << "_" << order ; 561 660 562 //delete hPosOfMax[order];661 delete hPosOfMax[order]; 563 662 } 564 663 … … 568 667 if (mOptions.Contains("S")) 569 668 { 570 if (mVerbosityLevel > 3) cout << endl << "\t\t...deleting hSlopeRisingEdge"; 669 if (mVerbosityLevel > 3) 670 cout << endl << "\t\t...deleting hSlopeRisingEdge"; 571 671 delete[] hSlopeRisingEdge; 572 672 hSlopeRisingEdge = NULL; … … 575 675 if (mOptions.Contains("R")) 576 676 { 577 if (mVerbosityLevel > 3) cout << endl << "\t\t...deleting hRisingEdgeToMax"; 677 if (mVerbosityLevel > 3) 678 cout << endl << "\t\t...deleting hRisingEdgeToMax"; 578 679 delete[] hRisingEdgeToMax; 579 680 hRisingEdgeToMax = NULL; … … 582 683 if (mOptions.Contains("M")) 583 684 { 584 if (mVerbosityLevel > 3) cout << endl << "\t\t...deleting hPosOfMax"; 685 if (mVerbosityLevel > 3) 686 cout << endl << "\t\t...deleting hPosOfMax"; 585 687 delete[] hPosOfMax; 586 688 hPosOfMax = NULL; … … 636 738 delete[] hPixelMean; 637 739 hPixelMean = NULL; 740 } 741 // end of DeleteTemplateHistos 742 //---------------------------------------------------------------------------- 743 744 void 745 Pixel::DeleteEdgeTemplateHistos() 746 { 747 if (mVerbosityLevel > 2) 748 { 749 cout << endl 750 << "\t...delete current template histograms of Pixel# " << mChid; 751 } 752 for (int order = 0; 753 order < mMaxPulseOrder; 754 order ++) 755 { 756 if (mVerbosityLevel > 3) 757 cout << endl << "\t\t...deleting hPixelEdgeMax" 758 << mChid << "_" << order 759 << " hPixelEdgeMax[order] adr " << hPixelEdgeMax[order] 760 << " hPixelEdgeMax adr " << hPixelEdgeMax 761 ; 762 763 delete hPixelEdgeMax[order]; 764 hPixelEdgeMax[order] = NULL; 765 766 if (mVerbosityLevel > 3) cout << endl << "\t\t...deleting hPixelEdgeMedian" 767 << mChid << "_" << order ; 768 delete hPixelEdgeMedian[order]; 769 hPixelEdgeMedian[order] = NULL; 770 771 if (mVerbosityLevel > 3) cout << endl << "\t\t...deleting hPixelEdgeMean" 772 << mChid << "_" << order ; 773 delete hPixelEdgeMean[order]; 774 hPixelEdgeMean[order] = NULL; 775 776 } 777 if (mVerbosityLevel > 3) cout << endl << "\t...deleting histogram Arrays"; 778 779 if (mVerbosityLevel > 3) cout << endl << "\t\t...deleting hPixelEdgeMax"; 780 delete[] hPixelEdgeMax; 781 hPixelEdgeMax = NULL; 782 783 if (mVerbosityLevel > 3) cout << endl << "\t\t...deleting hPixelEdgeMedian"; 784 delete[] hPixelEdgeMedian; 785 hPixelEdgeMedian = NULL; 786 787 if (mVerbosityLevel > 3) cout << endl << "\t\t...deleting hPixelEdgeMean"; 788 delete[] hPixelEdgeMean; 789 hPixelEdgeMean = NULL; 638 790 } 639 791 // end of DeleteTemplateHistos
Note:
See TracChangeset
for help on using the changeset viewer.