{ TCanvas *canEpsilonY[nointervals]; for (Int_t i = 0; iSetTitle(canvasTitle.Data()); canEpsilonY[i]->Divide(2, 3); che->SetLineColor(kBlack); for (Int_t j = 0; j < 6; j++) { //different files canEpsilonY[i]->cd(j+1); chs[j]->SetLineColor(kGray+1); chs[j]->SetFillColor(kGray+1); hsName.Form("hseY%d_%d", i, j); drawCommand.Form("fTap/f6BeIM>>%s(50,0,1)", hsName.Data()); chs[j]->Draw(drawCommand.Data(), cQ && crBeE[i] && crAngles && sRatio[j], "", sEvents[j]); hseY[i][j] = (TH1F*)gPad->FindObject(hsName.Data()); heName.Form("heeY%d_%d", i, j); drawCommand.Form("fTap/fBeIM>>%s(50,0,1)", heName.Data()); che->Draw(drawCommand.Data(), cQ && cBeE[i] && cAngles, "E same", eEvents[j]); heeY[i][j] = (TH1F*)gPad->FindObject(heName.Data()); hseY[i][j]->Draw(); heeY[i][j]->Draw("E same"); if (kAutoRange) { Float_t leftMaxMC = kRangeProportion*heeY[i][j]->GetMaximum(); Float_t leftMaxE = kRangeProportion*hseY[i][j]->GetMaximum(); hseY[i][j]->GetYaxis()->SetRangeUser(0, leftMaxE); leftMaxMC > leftMaxE ? hseY[i][j]->GetYaxis()->SetRangeUser(0, leftMaxMC) : hseY[i][j]->GetYaxis()->SetRangeUser(0, leftMaxE); } else { hseY[i][j]->GetYaxis()->SetRangeUser(0, eTRange[i][j]); } canEpsilonY[i]->Update(); // ti[j]->Draw("sTap/E_IM", ciBeE[i] && sRatio[j], "same", iEvents[j]); hiName.Form("hieY%d_%d", i, j); drawCommand.Form("sTap/E_IM>>%s(50,0,1)", hiName.Data()); ti[j]->Draw(drawCommand.Data(), ciBeE[i] && sRatio[j], "same"); TH1F *hieY[i][j] = (TH1F*)gPad->FindObject(hiName.Data()); Float_t rightmax = 1.1*hieY[i][j]->GetMaximum(); Float_t scale = canEpsilonY[i]->GetPad(j+1)->GetUymax()/rightmax; hieY[i][j]->SetLineColor(kRed); hieY[i][j]->Scale(scale); //draw an axis on the right side TGaxis *axis = new TGaxis(gPad->GetUxmax(),gPad->GetUymin(), gPad->GetUxmax(), gPad->GetUymax(),0,rightmax,510,"+L"); axis->SetLineColor(kRed); axis->SetLabelColor(kRed); axis->Draw(); canEpsilonY[i]->Update(); if (kVerbose) { Info("sfAngInt_epsilonY.cxx", "cut%d; case%d: %3.1f (exp)/ %3.1f (sim) = %3.3f", i, j, heeY[i][j]->Integral(0,heeY[i][j]->GetNbinsX()), hseY[i][j]->Integral(0,hseY[i][j]->GetNbinsX()), heeY[i][j]->Integral(0,heeY[i][j]->GetNbinsX())/hseY[i][j]->Integral(0,hseY[i][j]->GetNbinsX()) ); } }//for j if (savePictures) { canvasName.Form("%sfig%dEpsilonY:%s%s", ppath.Data(), i, configuration.Data(), pictFormat.Data()); cout << canvasName.Data() << endl; canEpsilonY[i]->SaveAs(canvasName.Data()); canEpsilonY[i]->cd(); canEpsilonY[i]->Close(); }//if save pictures }//if }//for i sw.Print(); sw.Continue(); }