void plot_2body(void) { // Input root file created with kinematics_2body and plot variables. // Original: Dec 09, 2009 // // // #include #include #include gROOT->Reset(); TFile *tfile = new TFile("kinematics_2body.root"); TTree *twobody = (TTree *) gROOT->FindObject("twobody"); gStyle->SetPalette(1,0); gStyle->SetOptStat(kFALSE); gStyle->SetOptFit(kFALSE); // gStyle->SetOptFit(1111); gStyle->SetPadRightMargin(0.15); gStyle->SetPadLeftMargin(0.15); gStyle->SetPadBottomMargin(0.15); gStyle->SetFillColor(0); // char string[256]; char filename[132]; Int_t j,jj; #define npts 8; #define pi 3.14159265; Double_t xmin=2; Double_t xmax=4; Double_t ymin=0.5; Double_t ymax=2.5; twobody->Print(); // TCanvas *c1 = new TCanvas("c1","Plot_2body Canvas",200,10,700,700); c1->SetBorderMode(0); c1->SetFillColor(0); c1->SetGridx(); c1->SetGridy(); c1->SetBorderMode(0); c1->SetFillColor(0); c1->Divide(2,2); c1->cd(1); twobody->SetMarkerStyle(20); twobody->SetMarkerSize(0.3); twobody->SetMarkerColor(2); twobody->SetTitle(""); twobody->Draw("theta_recoil:theta_scat"); c1->cd(2); twobody->Draw("Precoil:theta_recoil"); c1->cd(3); // twobody->Draw("Precoil:theta_scat","theta_scat<0.5"); twobody->Draw("Precoil:theta_scat"); c1->cd(4); twobody->Draw("Erecoil-mrecoil:Precoil"); /*TH2F *thr_vs_ths = new TH2F("thr_vs_ths","Theta recoil vs theta scat" TGraph *thresh = new TGraph (npts,combins,threshold); TLegend *leg = new TLegend(0.15,0.70,0.35,0.9); leg->AddEntry(thresh,"Combinations","p"); sprintf (string,"Hello=%s\n","hello"); printf ("%s",string); contour->SetTitle(""); contour->GetXaxis()->SetRangeUser(xmin,xmax); contour->GetYaxis()->SetRangeUser(ymin,ymax); contour->GetXaxis()->SetTitleSize(0.05); contour->GetYaxis()->SetTitleSize(0.05); contour->GetYaxis()->SetTitleOffset(1.5); contour->GetXaxis()->SetTitle("m_{Kp}^{2}"); contour->GetYaxis()->SetTitle("m_{KK}^{2}"); contour->GetXaxis()->SetNdivisions(5); contour->SetMarkerColor(1); contour->SetMarkerStyle(21); contour->Draw("AL"); sprintf(string,"m1=%f\n",m1); t1 = new TLatex(0.4,0.85,string); t1->SetTextColor(1); t1->SetNDC(); t1->Draw();*/ c1->SaveAs("plot_2body.eps"); c1->SaveAs("plot_2body.pdf"); }