- Timestamp:
- 05/08/12 11:37:08 (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
fact/tools/rootmacros/PulseTemplates/pixel.C
r13592 r13594 19 19 ) 20 20 { 21 mConstructorType = 1; 21 22 mChid = pixelID; 22 23 mStats = stats; … … 30 31 hEdgeProfile = new TProfile*[mMaxPulseOrder]; 31 32 33 hPixelMax = new TH1F*[mMaxPulseOrder]; 34 hPixelMedian = new TH1F*[mMaxPulseOrder]; 35 hPixelMean = new TH1F*[mMaxPulseOrder]; 36 32 37 hList = new TObjArray; 33 38 34 39 LoadPulseHistos( ); 40 BookTemplateHistos(); 35 41 } 36 42 … … 48 54 ) 49 55 { 56 mConstructorType = 0; 50 57 mChid = pixelID; 51 58 mStats = stats; ///TODO: HANDOVER THE VALUE … … 90 97 91 98 DeletePixelHistos(); 92 DeleteDistributionHistos(); 93 99 if (mConstructorType == 0) 100 { 101 DeleteDistributionHistos(); 102 } 103 104 if (mConstructorType == 1) 105 { 106 DeleteTemplateHistos(); 107 } 94 108 delete hList; 95 109 hList = NULL; … … 538 552 } 539 553 554 void 555 Pixel::BookTemplateHistos() 556 { 557 if (mVerbosityLevel > 2) cout << endl << "...book pixel histograms" << endl; 558 for (int order = 0; order < mMaxPulseOrder; order++) 559 { 560 if (mVerbosityLevel > 3) cout << "\t...booking " << HistoName("hPixelMax", order) << endl; 561 hPixelMax[order]=new TH1F( 562 HistoName("hPixelMax", order), 563 HistoTitle("Maximum value of each slice in overlay plot of", order), 564 mPixelOverlayXaxisLeft + mPixelOverlayXaxisRight , 565 (-1*mPixelOverlayXaxisLeft)-0.5, 566 mPixelOverlayXaxisRight-0.5 567 ); 568 569 hPixelMax[order]->SetAxisRange( 570 mBSLMean - 5, 571 (mGainMean*(order+1)) + 10, 572 "Y"); 573 hPixelMax[order]->GetXaxis()->SetTitle( "Timeslices [a.u.]" ); 574 hPixelMax[order]->GetYaxis()->SetTitle( "Amplitude [mV]" ); 575 //hMaxProfile->SetBit(TH2F::kCanRebin); 576 hPixelMax[order]->SetStats(mStats); 577 hList->Add( hPixelMax[order] ); 578 579 //------------------------------------------------------------------------ 580 581 if (mVerbosityLevel > 3) cout << "\t...booking " << HistoName("hPixelMean", order) << endl; 582 hPixelMean[order] = new TH1F( 583 HistoName("hPixelMean", order), 584 HistoTitle("Mean value of each slice in overlay plot of", order), 585 mPixelOverlayXaxisLeft + mPixelOverlayXaxisRight , 586 (-1*mPixelOverlayXaxisLeft)-0.5, 587 mPixelOverlayXaxisRight-0.5 588 ); 589 hPixelMean[order]->SetLineColor(kBlue); 590 hPixelMean[order]->SetAxisRange( 591 mBSLMean - 5, 592 (mGainMean*(order+1)) + 10, 593 "Y"); 594 hPixelMean[order]->GetXaxis()->SetTitle( "Timeslices [a.u.]" ); 595 hPixelMean[order]->GetYaxis()->SetTitle( "Amplitude [mV]" ); 596 hPixelMean[order]->SetStats(mStats); 597 hList->Add( hPixelMean[order] ); 598 599 //------------------------------------------------------------------------ 600 601 if (mVerbosityLevel > 3) cout << "\t...booking " << HistoName("hPixelMedian", order) << endl; 602 hPixelMedian[order] = new TH1F( 603 HistoName("hPixelMedian", order), 604 HistoTitle("Median value of each slice in overlay plot of", order), 605 mPixelOverlayXaxisLeft + mPixelOverlayXaxisRight ,//nbinsx 606 (-1*mPixelOverlayXaxisLeft)-0.5, //xlow 607 mPixelOverlayXaxisRight-0.5 //xup 608 ); 609 hPixelMedian[order]->SetLineColor(kRed); 610 hPixelMedian[order]->SetAxisRange( 611 mBSLMean - 5, 612 (mGainMean*(order+1)) + 10, 613 "Y"); 614 hPixelMedian[order]->GetXaxis()->SetTitle( "Timeslices [a.u.]" ); 615 hPixelMedian[order]->GetYaxis()->SetTitle( "Amplitude [mV]" ); 616 //hMaxProfile->SetBit(TH2F::kCanRebin); 617 hPixelMedian[order]->SetStats(mStats); 618 hList->Add( hPixelMedian[order] ); 619 620 } 621 if (mVerbosityLevel > 2) cout << "...done" << endl; 622 } 623 //end of BookTemplateHistos 624 //---------------------------------------------------------------------------- 625 626 void 627 Pixel::DeleteTemplateHistos() 628 { 629 if (mVerbosityLevel > 2) 630 { 631 cout << endl 632 << "\t...delete current template histograms of Pixel# " << mChid; 633 } 634 for (int order = 0; 635 order < mMaxPulseOrder; 636 order ++) 637 { 638 if (mVerbosityLevel > 3) 639 cout << endl << "\t\t...deleting hPixelMax" 640 << mChid << "_" << order 641 << " hPixelMax[order] adr " << hPixelMax[order] 642 << " hPixelMax adr " << hPixelMax 643 ; 644 645 delete hPixelMax[order]; 646 hPixelMax[order] = NULL; 647 648 if (mVerbosityLevel > 3) cout << endl << "\t\t...deleting hPixelMedian" 649 << mChid << "_" << order ; 650 delete hPixelMedian[order]; 651 hPixelMedian[order] = NULL; 652 653 if (mVerbosityLevel > 3) cout << endl << "\t\t...deleting hPixelMean" 654 << mChid << "_" << order ; 655 delete hPixelMean[order]; 656 hPixelMean[order] = NULL; 657 658 } 659 if (mVerbosityLevel > 3) cout << endl << "\t...deleting histogram Arrays"; 660 661 if (mVerbosityLevel > 3) cout << endl << "\t\t...deleting hPixelMax"; 662 delete[] hPixelMax; 663 hPixelMax = NULL; 664 665 if (mVerbosityLevel > 3) cout << endl << "\t\t...deleting hPixelMedian"; 666 delete[] hPixelMedian; 667 hPixelMedian = NULL; 668 669 if (mVerbosityLevel > 3) cout << endl << "\t\t...deleting hPixelMean"; 670 delete[] hPixelMean; 671 hPixelMean = NULL; 672 } 540 673 541 674 //============================= ACESS ===================================
Note:
See TracChangeset
for help on using the changeset viewer.