{ TCanvas *canEpsilonT[nointervals]; for (Int_t i = 0; iSetTitle(canvasTitle.Data()); canEpsilonT[i]->Divide(2, 3); che->SetLineColor(kBlack); for (Int_t j = 0; j < 6; j++) { //different files if (!kChains[j]) continue; canEpsilonT[i]->cd(j+1); chs[j]->SetLineColor(kGray+1); chs[j]->SetFillColor(kGray+1); hsName.Form("hseT%d_%d", i, j); // drawCommand.Form("fTpp/f6BeIM>>%s(50,0,1)", hsName.Data()); drawCommand.Form("fTpp/f6BeIM>>%s(30,0,1)", hsName.Data()); // chs[j]->Draw(drawCommand.Data(), cQ && crBeE[i] && crAngles && sRatio[j], "", sEventsECuts[i][j]); chs[j]->Draw(drawCommand.Data(), cProtons && cQ && crBeE[i] && crAngles && sRatio[j], "", sEventsECuts[i][j]); hseT[i][j] = (TH1F*)gPad->FindObject(hsName.Data()); heName.Form("heeT%d_%d", i, j); // drawCommand.Form("fTpp/fBeIM>>%s(50,0,1)", heName.Data()); drawCommand.Form("fTpp/fBeIM>>%s", heName.Data()); // che->Draw(drawCommand.Data(), cQ && cBeE[i] && cAngles, "E same", eEventsECuts[i][j]); che->Draw(drawCommand.Data(), cProtons && cQ && cBeE[i] && cAngles, "E same", eEventsECuts[i][j]); heeT[i][j] = (TH1F*)gPad->FindObject(heName.Data()); hseT[i][j]->Draw(); hseT[i][j]->SetTitle(""); hseT[i][j]->SetXTitle("\\varepsilon"); hseT[i][j]->GetXaxis()->SetTitleOffset(0.95); hseT[i][j]->GetXaxis()->CenterTitle(); hseT[i][j]->SetYTitle("counts"); // hseT[i][j]->GetYaxis()->SetTitleOffset(1.09); hseT[i][j]->GetYaxis()->SetTitleOffset(0.7); hseT[i][j]->GetYaxis()->CenterTitle(); heeT[i][j]->Draw("E same"); if (kAutoRange) { Float_t leftMaxMC = kRangeProportion*hseT[i][j]->GetMaximum(); Float_t leftMaxE = kRangeProportion*heeT[i][j]->GetMaximum(); hseT[i][j]->GetYaxis()->SetRangeUser(0, leftMaxE); leftMaxMC > leftMaxE ? hseT[i][j]->GetYaxis()->SetRangeUser(0, leftMaxMC) : hseT[i][j]->GetYaxis()->SetRangeUser(0, leftMaxE); } else { hseT[i][j]->GetYaxis()->SetRangeUser(0, eTRange[i][j]); } canEpsilonT[i]->Update(); hiName.Form("hieT%d_%d", i, j); // drawCommand.Form("sTpp/E_IM>>%s(50,0,1)", hiName.Data()); drawCommand.Form("sTpp/E_IM>>%s", hiName.Data()); ti[j]->Draw(drawCommand.Data(), ciBeE[i] && sRatio[j], "same"); TH1F *hieT[i][j] = (TH1F*)gPad->FindObject(hiName.Data()); Float_t rightmax = kRangeProportionIn*hieT[i][j]->GetMaximum(); Float_t scale = canEpsilonT[i]->GetPad(j+1)->GetUymax()/rightmax; hieT[i][j]->SetLineColor(kRed); hieT[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(); canEpsilonT[i]->Update(); if (kVerbose) { Info("sfAngInt_epsilonT.cxx", "cut%d; case%d: %3.1f (exp)/ %3.1f (sim) = %3.3f", i, j, heeT[i][j]->Integral(0,heeT[i][j]->GetNbinsX()), hseT[i][j]->Integral(0,hseT[i][j]->GetNbinsX()), heeT[i][j]->Integral(0,heeT[i][j]->GetNbinsX())/hseT[i][j]->Integral(0,hseT[i][j]->GetNbinsX()) ); } }//for j if (kVerbose) cout << endl; if (savePictures) { canvasName.Form("%sfig%depsilonT:%s%s", ppath.Data(), i, configuration.Data(), pictFormat.Data()); cout << canvasName.Data() << endl; canEpsilonT[i]->SaveAs(canvasName.Data()); canEpsilonT[i]->cd(); canEpsilonT[i]->Close(); }//if save pictures }//if }//for i sw.Print(); sw.Continue(); }