00001 void fitslicesy() {
00002 
00003 
00004 
00005 
00006 
00007 
00008 
00009 
00010 
00011    
00012 
00013    gStyle->SetLabelSize(0.06,"x");
00014    gStyle->SetLabelSize(0.06,"y");
00015    gStyle->SetFrameFillColor(38);
00016    gStyle->SetTitleW(0.6);
00017    gStyle->SetTitleH(0.1);
00018 
00019 
00020    TString dir = gSystem->UnixPathName(gInterpreter->GetCurrentMacroName());
00021    dir.ReplaceAll("fitslicesy.C","../hsimple.C");
00022    dir.ReplaceAll("/./","/");
00023    if (!gInterpreter->IsLoaded(dir.Data())) gInterpreter->LoadMacro(dir.Data());
00024    TFile *hsimple = (TFile*)gROOT->ProcessLineFast("hsimple(1)");
00025    if (!hsimple) return;
00026    TH2F *hpxpy = (TH2F*)hsimple->Get("hpxpy");
00027 
00028 
00029    TCanvas *c1 = new TCanvas("c1","c1",700,500);
00030    c1->SetFillColor(42);
00031    c1->Divide(2,1);
00032    c1->cd(1);
00033    TPad *left = (TPad*)gPad;
00034    left->Divide(1,2);
00035 
00036 
00037    left->cd(1);
00038    gPad->SetTopMargin(0.12);
00039    gPad->SetFillColor(33);
00040    hpxpy->Draw();
00041    hpxpy->GetXaxis()->SetLabelSize(0.06);
00042    hpxpy->GetYaxis()->SetLabelSize(0.06);
00043    hpxpy->SetMarkerColor(kYellow);
00044 
00045 
00046    hpxpy->FitSlicesY(0,7,32,20);
00047 
00048 
00049    left->cd(2);
00050    gPad->SetFillColor(33);
00051    hpxpy_0->Draw();
00052    c1->cd(2);
00053    TPad *right = (TPad*)gPad;
00054    right->Divide(1,2);
00055    right->cd(1);
00056    gPad->SetTopMargin(0.12);
00057    gPad->SetLeftMargin(0.15);
00058    gPad->SetFillColor(33);
00059    hpxpy_1->Draw();
00060 
00061 
00062    right->cd(2);
00063    gPad->SetTopMargin(0.12);
00064    gPad->SetLeftMargin(0.15);
00065    gPad->SetFillColor(33);
00066    hpxpy_2->SetMinimum(0.8);
00067    hpxpy_2->Draw();
00068 
00069 
00070    hpxpy_0->SetLineColor(kYellow);
00071    hpxpy_1->SetLineColor(kYellow);
00072    hpxpy_2->SetLineColor(kYellow);
00073    hpxpy_0->SetMarkerColor(kRed);
00074    hpxpy_1->SetMarkerColor(kRed);
00075    hpxpy_2->SetMarkerColor(kRed);
00076    hpxpy_0->SetMarkerStyle(21);
00077    hpxpy_1->SetMarkerStyle(21);
00078    hpxpy_2->SetMarkerStyle(21);
00079    hpxpy_0->SetMarkerSize(0.6);
00080    hpxpy_1->SetMarkerSize(0.6);
00081    hpxpy_2->SetMarkerSize(0.6);
00082 }