#include "TCanvas.h" void figSpectraIntegral() { TStopwatch sw; sw.Start(); const Int_t lowfile = 0; const Int_t upfile = 40; const Int_t lowrfile = 0; const Int_t uprfile = 0; // TChain *che = BeWork::OpenChain("/data2/be/rootdata/correlations/Be.", TChain *che = BeWork::OpenChain("../../../be/rootdata/correlations/v5_exp/Be.", lowfile, upfile, "beonly"); //original file Info("figSpectraIntegral", "%lld events in chain \"%s\" containing experimental data", che->GetEntries(), che->GetName()); // // TChain *cheRaw = BeWork::OpenChain("/data2/be/rootdata/correlations/Exp.", lowfile, upfile, "be", kBlack); // // TChain *chraw = BeWork::OpenChain("/data2/be/rootdata/correlations/Exp.", // lowrfile, uprfile, "be"); //original file // Info("statesRatioFitting.cxx", "%d events in chain \"%s\" containing experimental data", // chraw->GetEntries(), chraw->GetName()); const Bool_t savePictures = 0; TString pictureName; TString picturePath = "figures/"; // TString pictFormat = ".jpg"; TString pictFormat = ".eps"; // TString pictFormat = ".gif"; Int_t wtopx = 0, wtopy = 0; UInt_t ww = 0, wh = 0; // if (kspectrum1D) { TCanvas *cSpectrum = new TCanvas("spectrumIntegral", "spectrum up to 16 MeV"); cSpectrum->Divide(1,2, 0., 0.); // cSpectrum->SetBottomMargin(0.15); cSpectrum->cd(1); che->Draw("fBeIM>>hBe(200,0,7.9)", "fBeIM<7.9"); TH1F *hBe = (TH1F*)gPad->FindObject("hBe"); hBe->SetTitle(""); hBe->SetLineColor(kGray+2); hBe->SetFillColor(kGray+2); hBe->SetXTitle("E_{T} (MeV)"); hBe->GetXaxis()->SetTitleOffset(0.71); hBe->GetXaxis()->SetLabelSize(0.05); hBe->GetXaxis()->SetTitleSize(0.09); hBe->GetXaxis()->CenterTitle(); hBe->SetYTitle("Counts"); hBe->GetYaxis()->SetTitleOffset(0.75); hBe->GetYaxis()->SetLabelSize(0.05); hBe->GetYaxis()->SetTitleSize(0.09); hBe->GetYaxis()->CenterTitle(); hBe->GetYaxis()->SetRangeUser(0,19000); hBe->GetXaxis()->SetNdivisions(516); // TLine *lineE[4]; // // lineE[0] = new TLine(3, 45, 3, 120); // lineE[1] = new TLine(0, 45, 0, 120); // lineE[2] = new TLine(0, 120, 3, 120); // lineE[3] = new TLine(0, 45, 3, 45); cSpectrum->cd(2); che->Draw("fBeThetaCM1*TMath::RadToDeg():fBeIM>>hBe2D(100,0,7.9, 100,0,179)", "fBeIM<7.9", "cont"); TH2F *hBe2D = (TH2F*)gPad->FindObject("hBe2D"); hBe2D->SetTitle(""); hBe2D->SetLineColor(kGray+2); hBe2D->SetFillColor(kGray+2); hBe2D->SetXTitle("E_{T} (MeV)"); hBe2D->GetXaxis()->SetTitleOffset(0.71); hBe2D->GetXaxis()->SetLabelSize(0.05); hBe2D->GetXaxis()->SetTitleSize(0.09); hBe2D->GetXaxis()->CenterTitle(); hBe2D->SetYTitle("\\theta_{Be} (deg.)"); hBe2D->GetYaxis()->SetTitleOffset(0.60); hBe2D->GetYaxis()->SetLabelSize(0.05); hBe2D->GetYaxis()->SetTitleSize(0.09); hBe2D->GetYaxis()->CenterTitle(); hBe2D->GetXaxis()->SetNdivisions(516); TLine *line[4]; line[0] = new TLine(3, 45, 3, 120); line[1] = new TLine(0, 45, 0, 120); line[2] = new TLine(0, 120, 3, 120); line[3] = new TLine(0, 45, 3, 45); for (Int_t i = 0; i < 4; i++) { line[i]->SetLineWidth(3); line[i]->SetLineColor(kRed); line[i]->Draw("same"); } if (savePictures) { pictureName.Form("%s%s%s", picturePath.Data(), cSpectrum->GetName(), pictFormat.Data()); cSpectrum->SaveAs(pictureName.Data()); cSpectrum->cd(); cSpectrum->Close(); } // } // if (kThetaLab) { // TCanvas *cThetas = new TCanvas("thetaLab", "really measured thetas in lab frame"); // che->Draw("fAThetaLab*TMath::RadToDeg()>>hATheta(500,0,27)", ""); // che->Draw("fP1ThetaLab*TMath::RadToDeg()>>hAP1(100,0,27)", "", "same goff"); // che->Draw("fP2ThetaLab*TMath::RadToDeg()>>hAP2(100,0,27)", "", "same goff"); // TH1F *hATheta = (TH1F*)gPad->FindObject("hATheta"); // hATheta->SetTitle(""); //// hATheta->SetLineColor(kGray+2); //// hATheta->SetFillColor(kGray+2); // hATheta->SetXTitle("\\theta_{lab} [\\circ]"); // hATheta->GetXaxis()->SetTitleOffset(0.95); // hATheta->GetXaxis()->CenterTitle(); // hATheta->SetYTitle("Events"); // hATheta->GetYaxis()->SetTitleOffset(1.1); // hATheta->GetYaxis()->CenterTitle(); // hATheta->SetLineColor(kRed); // hATheta->SetFillColor(kRed); // hATheta->SetFillStyle(3005); // // TH1F hP(*hAP2); // hP.Add(hAP1); // hP.SetLineColor(kBlue); // hP.SetFillColor(kBlue); // hP.SetFillStyle(3004); // hP.Draw("same"); // // if (savePictures) { // pictureName.Form("%s%s%s", picturePath.Data(), cThetas->GetName(), pictFormat.Data()); // cThetas->SaveAs(pictureName.Data()); // cThetas->cd(); // cThetas->Close(); // } // } }