{ #define NSlug 19 const Int_t NR = NSlug - 2; const Int_t NL1 = 10; const Int_t NL2 = NSlug - 17; Double_t asymR[NR], asymRerr[NR], slugR[NR], slugRerr[NR]; Double_t avgRIN =0, sigmaRIN =0, avgROUT = 0, sigmaROUT = 0; Double_t asymL1[NL1], asymL1err[NL1], slugL1[NL1], slugL1err[NL1]; Double_t avgL1IN = 0, sigmaL1IN = 0, avgL1OUT = 0, sigmaL1OUT = 0; Double_t asymL2[NL2], asymL2err[NL2], slugL2[NL2], slugL2err[NL2]; Double_t avgL2IN = 0, sigmaL2IN = 0, avgL2OUT = 0, sigmaL2OUT = 0; Int_t HWP[NSlug] = {1,-1,1,-1,1,-1,1,-1,1,-1,1,-1,1,-1,1,1,-1,-1,1}; /////right arm Int_t k = 0; Int_t NINR = 0, NOUTR = 0; for (Int_t i=0; i < NSlug; i++) { if ((i == 11) || (i == 12)) continue; slugR[k] = i+1; slugRerr[k] = 0; if (i < 9) TString rfn = "~/pvdis/wac/ROOTfiles/parity09_000"; else TString rfn = "~/pvdis/wac/ROOTfiles/parity09_00"; rfn += i+1; rfn += "_slug.root"; TFile *_file0 = TFile::Open(rfn); cout<<"open rootfile successful!"<Draw(sr, "ok_regR", "goff"); asymR[k] = h1->GetMean(); rmstemp = h1->GetRMS(); enttemp = h1->GetEntries(); if (enttemp <= 0) { cout<<"ERROR: Slug"<Draw(sl1, "ok_regL", "goff"); asymL1[k1] = h1->GetMean(); rmstemp = h1->GetRMS(); enttemp = h1->GetEntries(); if (enttemp <= 0) { cout<<"ERROR: Slug"<Draw(sl2, "ok_regL", "goff"); asymL2[k2] = h1->GetMean(); rmstemp = h1->GetRMS(); enttemp = h1->GetEntries(); if (enttemp <= 0) { cout<<"ERROR: Slug"<SetTitle("asymmetries of right arm, P0 = 2.63GeV"); gRIN->GetXaxis()->SetTitle("Slug"); gRIN->GetYaxis()->SetTitle("asymmetry (ppm)"); gRIN->GetYaxis()->SetRangeUser(-300, 300); gRIN->SetMarkerStyle(20); gRIN->SetMarkerSize(1.5); gRIN->SetMarkerColor(kRed); gRIN->SetLineColor(kRed); gRIN->Draw("AP"); TGraphErrors *gROUT = new TGraphErrors(NOUTR, slugROUT, asymROUT, slugROUTerr, asymROUTerr); gROUT->SetMarkerStyle(22); gROUT->SetMarkerSize(1.5); gROUT->SetMarkerColor(kBlue); gROUT->SetLineColor(kBlue); gROUT->Draw("sameP"); TLine *lROUT = new TLine(1.00,avgROUT,19.0,avgROUT); lROUT->SetLineWidth(3); lROUT->SetLineColor(kBlue); lROUT->Draw("same"); TString tROUT = Form("HWP OUT, asym(blinded) = %.1f +/- %.1f(ppm)", avgROUT, errROUT); tex = new TLatex(2.0,250,tROUT); tex->SetLineWidth(3); tex->SetTextColor(kBlue); tex->Draw("same"); TLine *lRIN = new TLine(1.0, avgRIN, 19.0, avgRIN); lRIN->SetLineWidth(3); lRIN->SetLineColor(kRed); lRIN->Draw("same"); TString tRIN = Form("HWP IN, asym(blinded) = %.1f +/- %.1f(ppm)", avgRIN, errRIN); texRIN = new TLatex(2.0, -250, tRIN); texRIN->SetLineWidth(3); texRIN->SetTextColor(kRed); texRIN->Draw("same"); /////////////plotting left kine 1 TCanvas *c2 = new TCanvas("c2", "left arm asymmetries kine 1", 1400, 1000); // c2->DrawFrame(1,-150,12,150); TGraphErrors *gL1IN = new TGraphErrors(NINL1, slugL1IN, asymL1IN, slugL1INerr, asymL1INerr); gL1IN->SetTitle("asymmetries of left arm, P0 = 3.66GeV"); gL1IN->GetXaxis()->SetTitle("Slug"); gL1IN->GetYaxis()->SetTitle("asymmetry (ppm)"); gL1IN->GetYaxis()->SetRangeUser(-150, 150); // gL1IN->GetXaxis()->SetMinimum(1); // gL1IN->GetXaxis()->SetMaximum(12); gL1IN->GetXaxis()->SetLimits(1,12); gL1IN->SetMarkerStyle(20); gL1IN->SetMarkerSize(1.5); gL1IN->SetMarkerColor(kRed); gL1IN->SetLineColor(kRed); gL1IN->Draw("AP"); TGraphErrors *gL1OUT = new TGraphErrors(NOUTL1, slugL1OUT, asymL1OUT, slugL1OUTerr, asymL1OUTerr); gL1OUT->SetMarkerStyle(22); gL1OUT->SetMarkerSize(1.5); gL1OUT->SetMarkerColor(kBlue); gL1OUT->SetLineColor(kBlue); gL1OUT->Draw("sameP"); TLine *lL1OUT = new TLine(2.00,avgL1OUT,11.0,avgL1OUT); lL1OUT->SetLineWidth(3); lL1OUT->SetLineColor(kBlue); lL1OUT->Draw("same"); TString tL1OUT = Form("HWP OUT, asym(blinded) = %.1f +/- %.1f(ppm)", avgL1OUT, errL1OUT); texL1OUT = new TLatex(2.0,100,tL1OUT); texL1OUT->SetLineWidth(3); texL1OUT->SetTextColor(kBlue); texL1OUT->Draw("same"); TLine *lL1IN = new TLine(2.0, avgL1IN, 11.0, avgL1IN); lL1IN->SetLineWidth(3); lL1IN->SetLineColor(kRed); lL1IN->Draw("same"); TString tL1IN = Form("HWP IN, asym(blinded) = %.1f +/- %.1f(ppm)", avgL1IN, errL1IN); texL1IN = new TLatex(2.0, -100, tL1IN); texL1IN->SetLineWidth(3); texL1IN->SetTextColor(kRed); texL1IN->Draw("same"); }