{ TCanvas *cThetaAT[nointervals]; for (Int_t i = 0; iSetTitle(canvasTitle.Data()); cThetaAT[i]->Divide(2, 3); che->SetLineColor(kBlack); for (Int_t j = 0; j < 6; j++) { //different files if (!kChains[j]) continue; cThetaAT[i]->cd(j+1); hsName.Form("hsthetaAT%d_%d", i, j); hsthetaAT[i][j] = new TH1F(hsName.Data(), "title", 50, 0, 3.14); // hsthetaAT[i][j] = new TH1F(hsName.Data(), "title", 50, -1, 1); hsthetaAT[i][j]->SetLineColor(kGray+1); hsthetaAT[i][j]->SetFillColor(kGray+1); drawCommand.Form("fAThetaCM>>%s", hsthetaAT[i][j]->GetName()); // drawCommand.Form("cos(fAThetaCM)>>%s", hsthetaAT[i][j]->GetName()); chs[j]->Draw(drawCommand.Data(), cQ && crBeE[i] && crAngles && crEpsilonT && sRatio[j], "goff", sEventsECuts[i][j]); heName.Form("hethetaAT%d_%d", i, j); hethetaAT[i][j] = new TH1F(heName.Data(), "title", 50, 0, 3.14); // hethetaAT[i][j] = new TH1F(heName.Data(), "title", 50, -1, 1); drawCommand.Form("fAThetaCM>>%s", hethetaAT[i][j]->GetName()); // drawCommand.Form("cos(fAThetaCM)>>%s", hethetaAT[i][j]->GetName()); che->Draw(drawCommand.Data(), cQ && cBeE[i] && cAngles && cEpsilonT, "goff", eEventsECuts[i][j]); hsthetaAT[i][j]->Draw(); hsthetaAT[i][j]->SetTitle(""); hsthetaAT[i][j]->SetXTitle("\\theta_{\\alpha} [rad]"); hsthetaAT[i][j]->GetXaxis()->SetTitleOffset(0.95); hsthetaAT[i][j]->GetXaxis()->CenterTitle(); hsthetaAT[i][j]->SetYTitle("counts"); // hsthetaAT[i][j]->GetYaxis()->SetTitleOffset(1.09); hsthetaAT[i][j]->GetYaxis()->SetTitleOffset(0.7); hsthetaAT[i][j]->GetYaxis()->CenterTitle(); hethetaAT[i][j]->Draw("E same"); if (kAutoRange) { Float_t leftMaxMC = kRangeProportion*hethetaAT[i][j]->GetMaximum(); Float_t leftMaxE = kRangeProportion*hsthetaAT[i][j]->GetMaximum(); hsthetaAT[i][j]->GetYaxis()->SetRangeUser(0, leftMaxE); leftMaxMC > leftMaxE ? hsthetaAT[i][j]->GetYaxis()->SetRangeUser(0, leftMaxMC) : hsthetaAT[i][j]->GetYaxis()->SetRangeUser(0, leftMaxE); } else { hsthetaAT[i][j]->GetYaxis()->SetRangeUser(0, eTRange[i][j]); } cThetaAT[i]->Update(); hiName.Form("hithetaAT%d_%d", i, j); drawCommand.Form("sACM.Theta()>>%s(50,0,3.14)", hiName.Data()); // drawCommand.Form("cos(sACM.Theta())>>%s(50,-1,1)", hiName.Data()); ti[j]->Draw(drawCommand.Data(), ciEpsilon && ciBeE[i] && sRatio[j], "same"); TH1F *hithetaAT[i][j] = (TH1F*)gPad->FindObject(hiName.Data()); Float_t rightmax = 1.1*hithetaAT[i][j]->GetMaximum(); Float_t scale = cThetaAT[i]->GetPad(j+1)->GetUymax()/rightmax; hithetaAT[i][j]->SetLineColor(kRed); hithetaAT[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(); cThetaAT[i]->Update(); if (kVerbose) { Info("sfAngInt_thetaAT.cxx", "cut%d; case%d: %3.1f (exp)/ %3.1f (sim) = %3.3f", i, j, hethetaAT[i][j]->Integral(0,hethetaAT[i][j]->GetNbinsX()), hsthetaAT[i][j]->Integral(0,hsthetaAT[i][j]->GetNbinsX()), hethetaAT[i][j]->Integral(0,hethetaAT[i][j]->GetNbinsX())/hsthetaAT[i][j]->Integral(0,hsthetaAT[i][j]->GetNbinsX()) ); } }//for j if (savePictures) { canvasName.Form("%sfig%dthetaAT:%s%s", ppath.Data(), i, configuration.Data(), pictFormat.Data()); cThetaAT[i]->SaveAs(canvasName.Data()); cThetaAT[i]->cd(); cThetaAT[i]->Close(); } }//if }//for i sw.Print(); sw.Continue(); }