Changeset 5490 for trunk/MagicSoft/Mars
- Timestamp:
- 11/28/04 15:46:12 (20 years ago)
- Location:
- trunk/MagicSoft/Mars/mtemp/mmpi
- Files:
-
- 2 added
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/mtemp/mmpi/MSkyPlot.cc
r5349 r5490 123 123 #include <TLatex.h> 124 124 #include <TCanvas.h> 125 #include <TPaveLabel.h> 125 126 #include <TPaveText.h> 126 127 #include <TStopwatch.h> … … 281 282 } 282 283 284 kSaveAlphaPlots=kTRUE; 285 kSaveSkyPlots=kTRUE; 286 kSaveNexPlot=kTRUE; 283 287 fAlphaHName = "alphaplot.root"; 284 288 fSkyHName = "skyplot.root"; 289 fNexHName = "Nexcess.gif"; 285 290 } 286 291 … … 352 357 fMinYGrid = ymin; 353 358 fMaxYGrid = ymax; 359 360 *fLog << endl << inf << " SetSkyPlot: fMinXGrid, fMaxXGrid, fMinYGrid, fMaxYGrid, fBinStepGrid: " << endl; 361 *fLog << inf << " " << fMinXGrid << ", " << fMaxXGrid << ", " << fMinYGrid << ", " 362 << fMaxYGrid<< ", " << fBinStepGrid << endl; 354 363 } 355 364 … … 473 482 // for the current pointing position and add a offset in the 474 483 // Fill function! 475 kSaveAlphaPlots=kTRUE;476 kSaveSkyPlots=kTRUE;477 484 478 485 // prepare skyplot … … 480 487 fNumStepsY = (int) ((fMaxYGrid - fMinYGrid) / fBinStepGrid + 1.5); 481 488 fNumalphahist = (int) (fNumStepsX * fNumStepsY + 0.5); 489 490 *fLog << inf << "SetSkyPlot: fNumStepsX, fNumStepsY, fNumalphahist: " 491 << fNumStepsX << ", " << fNumStepsY << ", " << fNumalphahist << endl; 482 492 483 493 // fHistSignif.SetName("SPSignif2ndOrder"); … … 519 529 fHistAlpha[i].SetDirectory(NULL); 520 530 } 531 //cout << " fHistAlpha[10].GetBinContent(5) " << fHistAlpha[10].GetBinContent(5) << endl; 521 532 522 533 delete temp; … … 626 637 */ 627 638 639 // make the center of the plot different from the center of the camera 628 640 /* 629 641 x_0 = fPntPosCam->GetX()*fMm2Deg; 630 642 y_0 = fPntPosCam->GetY()*fMm2Deg; 631 643 */ 632 x_0 = 0.; 644 x_0 = 0.; 633 645 y_0 = 0.; 634 646 … … 641 653 for (Int_t gridx = 0; gridx < fNumStepsX; gridx++) 642 654 { 655 643 656 xsource = fMinXGrid + gridx * fBinStepGrid; 657 644 658 /* derotation : rotate into camera coordinates */ 645 659 /* formel: (x_cam) (cos(gam) -sin(gam)) (xtilde) (x_0) … … 649 663 xsourcam = cosgam * xsource - singam * ysource + x_0; 650 664 ysourcam = singam * xsource + cosgam * ysource + y_0; 665 666 651 667 /* end derotatiom */ 668 // xsourcam = xsource; 669 // ysourcam = ysource; 652 670 653 671 /* calculate ALPHA und DIST according to the source position */ … … 698 716 const Int_t onbinsalpha = TMath::Nint(fAlphaONMax/fHistAlphaBinWidth); 699 717 700 // fit with gaus701 fHistSignifGaus.Fit("gaus");702 718 703 719 // fit function for the background … … 713 729 alpha_iterator = fHistAlpha.begin(); 714 730 731 fHistNexcess.Reset(); 732 fHistOn.Reset(); 733 fHistSignif.Reset(); 734 fHistSignifGaus.Reset(); 735 715 736 while( alpha_iterator != fHistAlpha.end() ) { 716 737 // find the bin in the 2dim histogram … … 751 772 } 752 773 774 // fit with gaus 775 fHistSignifGaus.Fit("gaus","N"); 776 777 753 778 //temp 754 779 /* … … 770 795 // TString stri2 = "skyplots.root"; 771 796 if(kSaveSkyPlots==kTRUE) SaveSkyPlots(fSkyHName); 797 798 // save nex plot: 799 if(kSaveNexPlot==kTRUE) SaveNexPlot(fNexHName); 772 800 773 801 fHistAlpha.clear(); … … 800 828 } 801 829 830 void MSkyPlot::SaveNexPlot(TString nexplotname) 831 { 832 gStyle->SetCanvasBorderMode(0); 833 gStyle->SetCanvasBorderSize(0); 834 gStyle->SetCanvasColor(10); 835 // gStyle->SetPadBorderMode(0); 836 // gStyle->SetPadBorderSize(0); 837 gStyle->SetPadColor(10); 838 gStyle->SetOptFit(0); 839 gStyle->SetOptStat(0); 840 gStyle->SetStatColor(10); 841 gStyle->SetPalette(1); 842 gStyle->SetPadRightMargin(0.16); 843 gStyle->SetPadLeftMargin(0.13); 844 845 TH2D tmp = fHistNexcess; 846 tmp.SetMaximum(470); 847 tmp.SetMinimum(-90); 848 TCanvas can("SkyPlot","SkyPlot", 0, 0, 800, 400); 849 can.Divide(2,1); 850 can.cd(1); 851 tmp.GetYaxis()->SetTitleOffset(1.3); 852 tmp.Draw("colz"); 853 TPaveLabel myname(fMinXGrid-0.5,fMinYGrid-0.4,fMinXGrid+0.3,fMinYGrid-0.2,"by D. Mazin"); 854 myname.Draw(); 855 856 can.cd(2); 857 fHistNexcess.SetMaximum(470); 858 fHistNexcess.SetMinimum(-40); 859 fHistNexcess.GetXaxis()->SetTitleOffset(1.3); 860 fHistNexcess.GetYaxis()->SetTitleOffset(1.6); 861 gPad->SetTheta(20); 862 fHistNexcess.Draw("lego2"); 863 can.Print(nexplotname); 864 // can.Print("test.root"); 865 } 802 866 803 867 void MSkyPlot::SaveSkyPlots(TString skyplotfilename) -
trunk/MagicSoft/Mars/mtemp/mmpi/MSkyPlot.h
r5349 r5490 80 80 Bool_t kSaveAlphaPlots; 81 81 Bool_t kSaveSkyPlots; 82 Bool_t kSaveNexPlot; 82 83 83 84 Float_t fMinXGrid; // [deg] , left edge of the skyplot … … 105 106 TString fAlphaHName; // name for histogram with alpha plots 106 107 TString fSkyHName; // name for histogram with sky plots 108 TString fNexHName; // name for canvas with Nex plot 107 109 108 110 Int_t DistancetoPrimitive(Int_t px, Int_t py); … … 128 130 void SetSizeMin(Float_t size) { fSizeMin = size; } // Absolute minimum Size 129 131 void SetSizeMax(Float_t size) { fSizeMax = size; } // Absolute maximum Size 130 // void SetMinLD(Float_t ratio) { fMinLD = ratio; } // Minimum ratio between length/dist131 // void SetMaxLD(Float_t ratio) { fMaxLD = ratio; } // Maximum ratio between length/dist132 132 void ReadCuts(const TString parSCinit); 133 133 void SetSkyPlot(Float_t xmin, Float_t xmax, Float_t ymin, Float_t ymax, Float_t step); 134 134 Double_t CalcLimit(Double_t *a, Double_t ls, Double_t ls2, Double_t dd2); 135 //void SaveSkyPlots(const TString skyplotfilename="skyplots.root"); 135 136 void SetOutputSkyName(TString outname2) { fSkyHName = outname2; } 137 void SaveSkyPlots(TString stri); 138 void SetNotSaveSkyPlots() { kSaveSkyPlots = kFALSE; } 139 136 140 137 141 void SetOutputAlphaName(TString outname1) { fAlphaHName = outname1; } 138 void SaveSkyPlots(TString stri); 142 void SaveAlphaPlots(const TString stri2); 143 void SetNotSaveAlphaPlots() { kSaveAlphaPlots = kFALSE; } 139 144 145 void SetOutputNexName(TString outname3) { fNexHName = outname3; } 146 void SaveNexPlot(const TString stri3); 147 void SetNotSaveNexPlot() { kSaveNexPlot = kFALSE; } 140 148 141 //void SaveAlphaPlots(const TString alphaplotfilename="alphaplots.root");142 void SetOutputSkyName(TString outname2) { fSkyHName = outname2; }143 void SaveAlphaPlots(const TString stri2);144 149 145 150 void SetAlphaCut(Float_t alpha);
Note:
See TracChangeset
for help on using the changeset viewer.