Changeset 14811 for fact/tools
- Timestamp:
- 01/31/13 12:32:27 (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
fact/tools/rootmacros/PulseTemplates/FCalcPulseTemplate.C
r14781 r14811 96 96 //---------------------------------------------------------------------------- 97 97 int FCalcPulseTemplate( 98 TString InRootFileName = "20120 309_017.root",98 TString InRootFileName = "20120802templ_0mV_entries.root", 99 99 // TString InRootFileName = "20120309_032.root", 100 TString InputPath = "analysis/analysis/FPulseTemplate/20120309_017/Overlay/", 100 // TString InputPath = "analysis/analysis/FPulseTemplate/20120309_017/Overlay/", 101 TString InputPath = "", 101 102 // TString InputPath = "analysis/analysis/FPulseTemplate/20120309_032/Overlay/", 102 103 TString OutputRootFileName = "test.root", 103 TString OutPutPath = " analysis/FPulseTemplate/20120309_017/",104 TString OutPutPath = "", 104 105 int firstpixel = 0, 105 int npixel = 1 00,106 int npixel = 1, 106 107 int pixelSetSize = 200, 107 108 int maxPulseOrder = 1, … … 111 112 bool saveResults = false, 112 113 // bool fitdata = false, 113 bool debugPixel = false,114 bool debugPixel = true, 114 115 // int refresh_rate = 500, //refresh rate for canvases 115 116 int verbosityLevel = 1 // different verbosity levels can be implemented here … … 549 550 ); 550 551 551 552 // ShiftStartOfHistoInXTo(553 // pixel[pixelID]->hEdgeOverlay[pulse_order],554 // 0555 // );556 557 // ShiftStartOfHistoInXTo(558 // pixel[pixelID]->hMaxOverlay[pulse_order],559 // 0560 // );561 562 552 PixelCsv.WritePointSet( 563 553 pixel[pixelID], … … 593 583 if (ProduceGraphic && debugPixel) 594 584 { 595 // pixel[pixelID]->hPixelEdgeMax[pulse_order]->GetXaxis()->SetLimits(596 // 0,597 // 300598 // );599 // pixel[pixelID]->hPixelEdgeMean[pulse_order]->GetXaxis()->SetLimits(600 // 0,601 // 300602 // );603 // pixel[pixelID]->hPixelEdgeMedian[pulse_order]->GetXaxis()->SetLimits(604 // 0,605 // 300606 // );607 // pixel[pixelID]->hPixelMax[pulse_order]->GetXaxis()->SetLimits(608 // 0,609 // 300610 // );611 // pixel[pixelID]->hPixelMean[pulse_order]->GetXaxis()->SetLimits(612 // 0,613 // 300614 // );615 // pixel[pixelID]->hPixelMedian[pulse_order]->GetXaxis()->SetLimits(616 // 0,617 // 300618 // );619 620 // pixel[pixelID]->hEdgeProfile[pulse_order]->GetXaxis()->SetLimits(621 // 0,622 // 300623 // );624 625 626 627 628 // pixel[pixelID]->ShiftHistoInY(629 // pixel[pixelID]->hPixelEdgeMax[pulse_order],630 // 0.25631 // );632 633 585 634 586 pixel[pixelID]->DrawTemplateHistograms( … … 652 604 653 605 cgpPixelPulses[pulse_order]->cd(8); 654 655 // pixel[pixelID]->hEdgeProfile[pulse_order]->SetLineColor(kBlack);656 // Pulse pulseMean("PulseMean", pixel[pixelID]->hEdgeProfile[pulse_order], 0);657 658 659 660 661 // double fit_parameters5[3];662 // fit_parameters5[0] = fit_parameters[0];663 // fit_parameters5[0] = fit_parameters[0];664 // FitPulse(665 // "hugo3",666 // pixel[pixelID]->hPixelEdgeMax[pulse_order],667 // pixel[pixelID]->hPixelEdgeMax[pulse_order]->GetMaximumBin()-12,668 // pixel[pixelID]->hPixelEdgeMax[pulse_order]->GetMaximumBin(),669 // fit_parameters5670 // );671 // cout << "Parameters\t" << fit_parameters[0] << "\n"672 // << fit_parameters[1] << "\n"673 // << fit_parameters[2] << "\n" << endl;674 675 // TF1 *func = new TF1("func", template_function, 0, 300, 10);676 677 // func->SetParameters(678 // -0.5, // bsl679 // pixel[pixelID]->hPixelEdgeMax[pulse_order]->GetXaxis()->GetFirst() + 50,680 // pixel[pixelID]->hPixelEdgeMax[pulse_order]->GetMaximumBin()681 // ); // range682 683 684 685 // func->SetParNames("baseline",686 // "begin of pol3", "begin of exp",687 // "exp-factor", "exp-tau", "ext-t0",688 // "pol3_0", "pol3_1", "pol3_2", "pol3_3"689 // );690 // pixel[pixelID]->hPixelEdgeMax[pulse_order]->Fit(func);691 692 // TH1F* hTest = new TH1F(693 // "hTest",694 // "Test",695 // pixel[pixelID]->mPixelOverlayXaxisLeft696 // + pixel[pixelID]->mPixelOverlayXaxisRight ,697 // (-1*pixel[pixelID]->mPixelOverlayXaxisLeft)-0.5,698 // pixel[pixelID]->mPixelOverlayXaxisRight-0.5699 // );700 701 // hTest->GetXaxis()->SetLimits(702 // 0,703 // 300704 // );705 706 // for (int bin = 0;707 // bin < pixel[pixelID]->hPixelEdgeMax[pulse_order]->GetXaxis()->GetLast();708 // bin++709 // )710 // {711 // hTest->SetBinContent( bin, (-1)*(fit_parameters[0]+TMath::Exp(fit_parameters[1]+fit_parameters[2]*(bin))) );712 // }713 714 // hTest->Add(pixel[pixelID]->hPixelEdgeMax[pulse_order], 1);715 716 // cgpPixelPulses[pulse_order]->cd(7);717 // hTest->Draw();718 719 // for (int bin = 0;720 // bin < pixel[pixelID]->hPixelEdgeMax[pulse_order]->GetXaxis()->GetLast();721 // bin++722 // )723 // {724 // hTest->SetBinContent( bin, (-1)*(hTest->GetBinContent(bin)) );725 // }726 727 728 // double fit_parameters2[3];729 // FitFallingEdge(730 // "hugo2",731 // hTest,732 // hTest->GetXaxis()->GetFirst()+68,733 // hTest->GetXaxis()->GetFirst()+80,734 // fit_parameters2735 // );736 737 // cgpPixelPulses[pulse_order]->cd(8);738 739 // TH1F* hTest2 = new TH1F(740 // "hTest2",741 // "Test",742 // pixel[pixelID]->mPixelOverlayXaxisLeft743 // + pixel[pixelID]->mPixelOverlayXaxisRight ,744 // (-1*pixel[pixelID]->mPixelOverlayXaxisLeft)-0.5,745 // pixel[pixelID]->mPixelOverlayXaxisRight-0.5746 // );747 748 // hTest2->GetXaxis()->SetLimits(749 // 0,750 // 300751 // );752 753 // for (int bin = 0;754 // bin < pixel[pixelID]->hPixelEdgeMax[pulse_order]->GetXaxis()->GetLast();755 // bin++756 // )757 // {758 // hTest2->SetBinContent( bin, (-1)*(hTest->GetBinContent(bin)) );759 // }760 761 // double fit_parameters3[3];762 // FitRisingEdge(763 // "hugo3",764 // hTest2,765 // hTest2->GetXaxis()->GetFirst()+68,766 // hTest2->GetXaxis()->GetFirst()+80,767 // fit_parameters3768 // );769 770 771 // hTest2->Draw();772 773 606 774 607 //------------------------------------- … … 785 618 786 619 // pulses.cd(1); 787 Pulse maxMaxPulse("maxMaxPulse", pixel[pixelID]->hPixelMax[pulse_order], "Q", 1 );620 Pulse maxMaxPulse("maxMaxPulse", pixel[pixelID]->hPixelMax[pulse_order], "Q", 1,pulse_order); 788 621 pulseFits[0] = &maxMaxPulse; 789 622 790 623 // pulses.cd(2); 791 Pulse maxMedianPulse("maxMedianPulse", pixel[pixelID]->hPixelMedian[pulse_order], "Q",1 );624 Pulse maxMedianPulse("maxMedianPulse", pixel[pixelID]->hPixelMedian[pulse_order], "Q",1,pulse_order); 792 625 pulseFits[1] = &maxMedianPulse; 793 626 794 627 // pulses.cd(3); 795 Pulse maxMeanPulse("maxMeanPulse", pixel[pixelID]->hPixelMean[pulse_order], "Q",1 );628 Pulse maxMeanPulse("maxMeanPulse", pixel[pixelID]->hPixelMean[pulse_order], "Q",1,pulse_order); 796 629 pulseFits[2] = &maxMeanPulse; 797 630 798 Pulse edgeMaxPulse("edgeMaxPulse", pixel[pixelID]->hPixelEdgeMax[pulse_order], "Q",1 );631 Pulse edgeMaxPulse("edgeMaxPulse", pixel[pixelID]->hPixelEdgeMax[pulse_order], "Q",1,pulse_order); 799 632 pulseFits[3] = &edgeMaxPulse; 800 633 801 Pulse edgeMedianPulse("edgeMedianPulse", pixel[pixelID]->hPixelEdgeMedian[pulse_order], "Q",1 );634 Pulse edgeMedianPulse("edgeMedianPulse", pixel[pixelID]->hPixelEdgeMedian[pulse_order], "Q",1,pulse_order); 802 635 pulseFits[4] = &edgeMedianPulse; 803 636 804 Pulse edgeMeanPulse("edgeMeanPulse", pixel[pixelID]->hPixelEdgeMean[pulse_order], "Q",1 );637 Pulse edgeMeanPulse("edgeMeanPulse", pixel[pixelID]->hPixelEdgeMean[pulse_order], "Q",1,pulse_order); 805 638 pulseFits[5] = &edgeMeanPulse; 806 639
Note:
See TracChangeset
for help on using the changeset viewer.