#include #include #include #include #include #include "TGraphAsymmErrors.h" #include "TLine.h" #include "TCanvas.h" #include "TMultiGraph.h" #include "TLegend.h" #include "TAxis.h" /* #include "atlasstyle-00-04-02/AtlasLabels.h" #include "atlasstyle-00-04-02/AtlasUtils.h" #include "atlasstyle-00-04-02/AtlasStyle.h" */ #include "PadmeLabels.h" #include "PadmeUtils.h" #include "PadmeStyle.h" #ifdef __CLING__ // these are not headers - do not treat them as such - needed for ROOT6 /* #include "atlasstyle-00-04-02/AtlasLabels.C" #include "atlasstyle-00-04-02/AtlasUtils.C" */ #include "PadmeLabels.C" #include "PadmeUtils.C" #include "PadmeStyle.C" #endif void makeTrendMoriond(); void makeTrendxSecRuns(){ /* //#ifdef __CINT__ gROOT->LoadMacro("PadmeLabels.C"); gROOT->LoadMacro("PadmeUtils.C"); gROOT->LoadMacro("PadmeStyle.C"); //#endif */ SetPadmeStyle(); gStyle->SetOptFit(0); gStyle->SetOptStat(0); gStyle->SetOptTitle(0); gStyle->SetCanvasPreferGL(1); gStyle->SetPalette(55); //makeTrend(); makeTrendMoriond(); //makePhiRGraph(); } void makePhiRGraph(){ TCanvas *c3 = new TCanvas("c3", "c3", 700,500); c3->cd(); //c3->SetBottomMargin(0.2); auto grEffIn= new TGraphErrors(8); grEffIn->SetMarkerColor(kBlue+2); //grEffIn->SetMarkerStyle(21); grEffIn->SetMarkerSize(0.7); auto grEffOut= new TGraphErrors(8); grEffOut->SetMarkerColor(kAzure+7); //grEffOut->SetMarkerStyle(21); grEffOut->SetMarkerSize(0.7); //old one //Double_t feffIn[8]={0.736, 0.773, 0.739, 0.72 , 0.706, 0.712, 0.7 , 0.743}; //Double_t feffOut[8]={0.703, 0.804, 0.75 , 0.75 , 0.782, 0.721, 0.696, 0.714}; //Double_t ferreffIn[8]={ 0.018,0.035,0.011,0.057,0.041,0.053,0.022,0.009}; //Double_t ferreffOut[8]={0.011, 0.031, 0.01 ,0.016,0.025,0.023,0.016,0.006}; //new one Double_t feffIn[8]={0.736, 0.790, 0.739, 0.72 , 0.728, 0.740, 0.719 , 0.731}; Double_t feffOut[8]={0.703, 0.741, 0.737 , 0.69 , 0.718, 0.721, 0.696, 0.714}; Double_t ferreffIn[8]={ 0.018,0.014, 0.011,0.057,0.046,0.058,0.035,0.009}; Double_t ferreffOut[8]={0.011, 0.028, 0.02 ,0.024,0.018,0.023,0.016,0.006}; std::string x_labels[8]={"30369","30386","30547","30553","30563","30617","30624", "All"}; for (Int_t i = 0; i < 8; i++) { grEffIn->SetPoint(i, i + 1., feffIn[i]); grEffIn->SetPointError(i, 0 , ferreffIn[i]); grEffOut->SetPoint(i, i + 1.08, feffOut[i]); grEffOut->SetPointError(i, 0 , ferreffOut[i]); } TMultiGraph *mg = new TMultiGraph(); mg->Add(grEffIn,"p"); mg->Add(grEffOut,"p"); mg->Draw("a"); for (Int_t i = 0; i < 8; i++) { mg->GetXaxis()->SetBinLabel(mg->GetXaxis()->FindBin(i + 1.), x_labels[i].c_str()); } PADME_LABEL(0.2,0.87); myText( 0.35,0.87,1,"Preliminary"); myText( 0.2,0.82,1,"Efficiency trend"); myText( 0.2,0.78,1,"nominal bunch #Delta t 280 ns",0.038); myText( 0.2,0.73,1,"EBeam = 430 MeV", 0.038); //TLine *line = new TLine(c3->GetUxmin(),1.0,c3->GetUxmax(),1.0); // xmin , ymin, xmax, ymax //line->SetLineStyle(8); //line->SetLineColor(kGray+1); //line->SetLineWidth(2); //line->Draw("SAME"); mg->GetYaxis()->SetRangeUser(0.6, 0.9); mg->GetYaxis()->SetTitle("#epsilon"); auto leg = new TLegend(0.55,0.7,0.9,0.9); leg->AddEntry(grEffIn, "#epsilon, inner ring", "lep"); leg->AddEntry(grEffOut, "#epsilon,outer ring", "lep"); leg->SetTextAlign(12); leg->SetBorderSize(0); leg->SetFillStyle(0); leg->SetFillColor(0); leg->SetTextFont(43); leg->SetTextSize(15); leg->Draw(); c3->SaveAs("~/html/allow_listing/PhDThesisImage/png/DataRooFitEffTrendRuns_clQnPOTselection.png"); c3->SaveAs("../../CPlot/DataRooFitEffTrendRuns_clQnPOTselection.C"); delete c3; return; } void makeTrend(){ std::string x_labels[8]={"30369","30386","30547","30553","30563","30617","30624", "All"}; Double_t nPOT[8]={81649724575.8, 27808076763.4,71341183911.7,28050480995.8,60224227759.5,61251354096.8,66320622918.5,396645671021.1}; //old one //Double_t feffIn[8]={0.736, 0.773, 0.739, 0.72 , 0.706, 0.712, 0.7 , 0.743}; //Double_t ferreffIn[8]={0.018,0.035,0.011,0.057,0.041, 0.053, 0.022, 0.009}; //Double_t feffOut[8]={0.703, 0.804, 0.75 , 0.75 , 0.782, 0.721, 0.696, 0.714}; //Double_t ferreffOut[8]={0.011, 0.031, 0.01 , 0.016, 0.025, 0.023, 0.016, 0.006}; //new one Double_t feffIn[8]={0.736, 0.790, 0.739, 0.72 , 0.728, 0.740, 0.719 , 0.731}; Double_t feffOut[8]={0.703, 0.741, 0.737 , 0.69 , 0.718, 0.721, 0.696, 0.714}; Double_t ferreffIn[8]={ 0.018,0.014, 0.011,0.057,0.046,0.058,0.035,0.009}; Double_t ferreffOut[8]={0.011, 0.028, 0.02 ,0.024,0.018,0.023,0.016,0.006}; //old one //Double_t fTagSortedIn[8]={74918 , 25656 , 65973 , 24240 , 51890 , 57951 , 63696 , 375623}; //Double_t ferrTagSortedIn[8]={1105.7, 965.6 , 848.8 , 474.2 , 1665.2, 1829.5, 1425.2, 2951.4}; //Double_t fTagSortedOut[8]={71134 , 26581 , 66487 , 25134 , 57143 , 58879 , 62892 , 360000}; //Double_t ferrTagSortedOut[8]={1678.2,1203.6, 931.2 , 1965.8, 3326.9, 4407.5, 1975 , 4252.1}; //new one Double_t fTagSortedIn[8]={74918 , 27854 , 67095 , 26343 , 56505 , 57951 , 63696 , 375623}; Double_t ferrTagSortedIn[8]={1105.7, 1038.3 , 1839 , 876.5 , 1356.2, 1829.5, 1425.2, 2951.4}; Double_t fTagSortedOut[8]={71134 , 26007 , 66487 , 25134 , 55459 , 56665 , 61268 , 365663}; Double_t ferrTagSortedOut[8]={1678.2,436.6, 928 , 1965.8, 3492.5, 4407.5, 3004.7 , 4252.1}; //Double_t fdPhi[8]={54079 , 21262 , 51070 , 18795 , 41874 , 42950 , 45319 , 274330}; //Double_t ferrdPhi[8]={ 233, 146, 226, 137, 205, 207, 213, 524}; //after DPhi baco correction 11/01/2022 Double_t fdPhi[8]={54567 , 21442 , 51473 , 19039 , 42205 , 43316 , 45697 , 276704}; Double_t ferrdPhi[8]={ 234, 146, 227, 138, 205, 208, 214, 526}; //old one //Double_t fevEff[8]={0.517, 0.621, 0.554, 0.54 , 0.552, 0.513, 0.487, 0.531}; //Double_t ferrevEff[8]={0.015, 0.037,0.011,0.044,0.037,0.042,0.019,0.008}; //new one Double_t fevEff[8]={0.517, 0.585, 0.545, 0.497 , 0.523, 0.534, 0.5, 0.522}; Double_t ferrevEff[8]={0.015, 0.024,0.017,0.043,0.036,0.045,0.027,0.008}; //Double_t Const=0.0634125*0.0105; Double_t Const=0.0642453*0.0105; Double_t tagCorrIn[8]={0.}; Double_t errtagCorrIn[8]={0.}; Double_t tagCorrOut[8]={0.}; Double_t errtagCorrOut[8]={0.}; Double_t xSectagCorrIn[8]={0.}; Double_t errxSectagCorrIn[8]={0.}; Double_t errSysxSectagCorrIn[8]={0.}; Double_t xSectagCorrOut_tmp[8]={0.}; Double_t errxSectagCorrOut_tmp[8]={0.}; Double_t errSysxSectagCorrOut_tmp[8]={0.}; Double_t xSectagCorrOut[8]={0.}; Double_t errxSectagCorrOut[8]={0.}; Double_t errSysxSectagCorrOut[8]={0.}; Double_t dPhiCorr[8]={0.}; Double_t errdPhiCorr[8]={0.}; Double_t xSecdPhiCorr[8]={0.}; Double_t errxSecdPhiCorr[8]={0.}; Double_t errSysxSecdPhiCorr[8]={0.}; Double_t DPhi_wmean2=0.; Double_t DPhi_wmean=0.; Double_t DPhi_err2=0.; Double_t DPhi_norm=0.; Double_t DPhi_werrmean=0.; Double_t DPhi_errnorm=0.; Double_t TagIn_wmean2=0.; Double_t TagIn_wmean=0.; Double_t TagIn_err2=0.; Double_t TagIn_norm=0.; Double_t TagIn_werrmean=0.; Double_t TagIn_errnorm=0.; Double_t TagOut_wmean2=0.; Double_t TagOut_wmean=0.; Double_t TagOut_err2=0.; Double_t TagOut_norm=0.; Double_t NggWMean_DPhi =1.98167 ;// 1.99986; Double_t NggWMean_tagIn = 1.90825; //1.92711; Double_t NggWMean_tagOut=1.89756; // 1.91892; Double_t DPhiTagIn_wmean2=0.; Double_t DPhiTagIn_wmean=0.; Double_t DPhiTagIn_err2=0.; Double_t DPhiTagIn_norm=0.; Double_t NggWMean_DPhiTagIn = -0.0555001; TH1F* hDPhi = new TH1F("hDPhi", "hDPhi", 50, 1.70, 2.4); TH1F* hTagIn = new TH1F("hTagIn", "hTagIn", 50, 1.70, 2.4); TH1F* hTagOut = new TH1F("hTagOut", "hTagOut", 50, 1.70, 2.4); TH1F* hDPhiTagIn = new TH1F("hDPhiTagIn", "hDPhiTagIn", 100, -1, 1); for(int i=0; i<8; i++){ Double_t norm= nPOT[i]*Const; tagCorrIn[i]=fTagSortedIn[i]/feffIn[i]; //errtagCorrIn[i]=sqrt((1/feffIn[i]/feffIn[i])*(1/feffIn[i]/feffIn[i])*ferrTagSortedIn[i]*ferrTagSortedIn[i] + (fTagSortedIn[i]/feffIn[i]/feffIn[i])*(fTagSortedIn[i]/feffIn[i]/feffIn[i] )*ferreffIn[i]*ferreffIn[i]); errtagCorrIn[i]=sqrt((1/feffIn[i]/feffIn[i])*ferrTagSortedIn[i]*ferrTagSortedIn[i] + (fTagSortedIn[i]/feffIn[i]/feffIn[i])*(fTagSortedIn[i]/feffIn[i]/feffIn[i] )*ferreffIn[i]*ferreffIn[i]); xSectagCorrIn[i]=tagCorrIn[i]/norm*1000; errxSectagCorrIn[i]= errtagCorrIn[i]/norm*1000; //errSysxSectagCorrIn[i]=sqrt((0.05*xSectagCorrIn[i])*(0.05*xSectagCorrIn[i])+errxSectagCorrIn[i]*errxSectagCorrIn[i]); errSysxSectagCorrIn[i]=errxSectagCorrIn[i]; if(i<7){ TagIn_wmean2=TagIn_wmean2+ (xSectagCorrIn[i]-NggWMean_tagIn)*(xSectagCorrIn[i]-NggWMean_tagIn)/errxSectagCorrIn[i]/errxSectagCorrIn[i]; TagIn_wmean=TagIn_wmean+ xSectagCorrIn[i]/errxSectagCorrIn[i]/errxSectagCorrIn[i]; //*nPOT[i]; TagIn_err2+=1/errxSectagCorrIn[i]/errxSectagCorrIn[i]; TagIn_norm+=1/errxSectagCorrIn[i]/errxSectagCorrIn[i];//nPOT[i]; hTagIn->Fill(xSectagCorrIn[i], errxSectagCorrIn[i]*nPOT[i] ); TagIn_werrmean=TagIn_werrmean+ xSectagCorrIn[i]*errxSectagCorrIn[i]; TagIn_errnorm+=errxSectagCorrIn[i]; } tagCorrOut[i]=fTagSortedOut[i]/feffOut[i]; //errtagCorrOut[i]=sqrt((1/feffOut[i]/feffOut[i])*(1/feffOut[i]/feffOut[i])*ferrTagSortedOut[i]*ferrTagSortedOut[i] + (fTagSortedOut[i]/feffOut[i]/feffOut[i])*(fTagSortedOut[i]/feffOut[i]/feffOut[i] )*ferreffOut[i]*ferreffOut[i]); errtagCorrOut[i]=sqrt((1/feffOut[i]/feffOut[i])*ferrTagSortedOut[i]*ferrTagSortedOut[i] + (fTagSortedOut[i]/feffOut[i]/feffOut[i])*(fTagSortedOut[i]/feffOut[i]/feffOut[i] )*ferreffOut[i]*ferreffOut[i]); xSectagCorrOut_tmp[i]=tagCorrOut[i]/norm*1000; errxSectagCorrOut_tmp[i]= errtagCorrOut[i]/norm*1000; //errSysxSectagCorrOut_tmp[i]=sqrt((0.05*xSectagCorrOut_tmp[i])*(0.05*xSectagCorrOut_tmp[i])+errxSectagCorrOut_tmp[i]*errxSectagCorrOut_tmp[i] ) ; errSysxSectagCorrOut_tmp[i]=errxSectagCorrOut_tmp[i]; if(i<7){ TagOut_wmean2=TagOut_wmean2+ (xSectagCorrOut_tmp[i]-NggWMean_tagOut)*(xSectagCorrOut_tmp[i]-NggWMean_tagOut)/errxSectagCorrOut_tmp[i]/errxSectagCorrOut_tmp[i]; TagOut_wmean=TagOut_wmean+ xSectagCorrOut_tmp[i]/errxSectagCorrOut_tmp[i]/errxSectagCorrOut_tmp[i]; //*nPOT[i]; TagOut_err2+=1/errxSectagCorrOut_tmp[i]/errxSectagCorrOut_tmp[i]; TagOut_norm+=1/errxSectagCorrOut_tmp[i]/errxSectagCorrOut_tmp[i]; //nPOT[i]; hTagOut->Fill(xSectagCorrOut_tmp[i],errxSectagCorrOut_tmp[i]*nPOT[i] ); } dPhiCorr[i]=fdPhi[i]/fevEff[i]; //errdPhiCorr[i]=sqrt((1/fevEff[i]/fevEff[i])*(1/fevEff[i]/fevEff[i])*ferrdPhi[i]*ferrdPhi[i] + (fdPhi[i]/fevEff[i]/fevEff[i])*(fdPhi[i]/fevEff[i]/fevEff[i] )*ferrevEff[i]*ferrevEff[i]); errdPhiCorr[i]=sqrt((1/fevEff[i]/fevEff[i])*ferrdPhi[i]*ferrdPhi[i] + (fdPhi[i]/fevEff[i]/fevEff[i])*(fdPhi[i]/fevEff[i]/fevEff[i] )*ferrevEff[i]*ferrevEff[i]); xSecdPhiCorr[i]=dPhiCorr[i]/norm*1000; errxSecdPhiCorr[i]=errdPhiCorr[i]/norm*1000; //errSysxSecdPhiCorr[i]=sqrt((0.05*xSecdPhiCorr[i])*(0.05*xSecdPhiCorr[i])+ errxSecdPhiCorr[i]* errxSecdPhiCorr[i]); errSysxSecdPhiCorr[i]=errxSecdPhiCorr[i]; if(i<7){ DPhi_wmean2=DPhi_wmean2+ (xSecdPhiCorr[i]-NggWMean_DPhi)*(xSecdPhiCorr[i]-NggWMean_DPhi)/errxSecdPhiCorr[i]/errxSecdPhiCorr[i]; DPhi_wmean=DPhi_wmean+ xSecdPhiCorr[i]/errxSecdPhiCorr[i]/errxSecdPhiCorr[i]; //*nPOT[i]; DPhi_err2+=1/errxSecdPhiCorr[i]/errxSecdPhiCorr[i]; DPhi_norm+=1/errxSecdPhiCorr[i]/errxSecdPhiCorr[i]; //nPOT[i]; DPhi_werrmean=DPhi_werrmean+ xSecdPhiCorr[i]*errxSecdPhiCorr[i]; DPhi_errnorm+=errxSecdPhiCorr[i]; hDPhi->Fill(xSecdPhiCorr[i],errxSecdPhiCorr[i]*nPOT[i] ); Double_t diff=xSectagCorrIn[i]- xSecdPhiCorr[i]; Double_t errdiff = sqrt(errxSectagCorrIn[i]*errxSectagCorrIn[i]+ errxSecdPhiCorr[i]*errxSecdPhiCorr[i]); DPhiTagIn_wmean+=DPhiTagIn_wmean+ diff*(fdPhi[i]+fTagSortedIn[i]); DPhiTagIn_norm+= (fdPhi[i]+fTagSortedIn[i]); DPhiTagIn_wmean2+=DPhiTagIn_wmean2+ (diff-NggWMean_DPhiTagIn)*(diff-NggWMean_DPhiTagIn)*errdiff*errdiff; DPhiTagIn_err2+=errdiff*errdiff; hDPhiTagIn->Fill(diff, errdiff*nPOT[i]); } } std::cout<<"meanWerr DPhi " << (DPhi_werrmean/DPhi_errnorm) << " tagIn " << (TagIn_werrmean/TagIn_errnorm) << " diff " << (DPhi_werrmean/DPhi_errnorm - TagIn_werrmean/TagIn_errnorm) << std::endl; //TCanvas *c2 = new TCanvas("c2", "c2", 1200,600); //c2->Divide(2,2); //c2->cd(1); //hDPhi->Draw(); //c2->cd(2); //hTagIn->Draw(); //c2->cd(3); //hTagOut->Draw(); //c2->cd(4); //hDPhiTagIn->Draw(); std::cout<<" NggWMean - DPhi "<< DPhi_wmean/DPhi_norm << " tagIn " << TagIn_wmean/ TagIn_norm << " tagOut " << TagOut_wmean/ TagOut_norm << std::endl; Double_t DPhiTagIn_RMS=sqrt(DPhiTagIn_wmean2/DPhiTagIn_err2); // std::cout<<"DPhiTagIn xSec difference "<< DPhiTagIn_wmean/ DPhiTagIn_norm << " RMS " << DPhiTagIn_RMS << std::endl; Double_t DPhi_RMS=sqrt(DPhi_wmean2/DPhi_err2); Double_t TagIn_RMS =sqrt(TagIn_wmean2/ TagIn_err2); Double_t TagOut_RMS=sqrt(TagOut_wmean2/TagOut_err2); std::cout<<"WRMS - DPhi " << DPhi_RMS << " tagIn " << TagIn_RMS << " tagOut " << TagOut_RMS << std::endl; std::cout<<"RMS from plot- DPhi " << hDPhi->GetRMS() << " tagIn " << hTagIn->GetRMS() << " tagOut " << hTagOut->GetRMS() << std::endl; //return; TCanvas *c1 = new TCanvas("c1", "c1", 700,500); c1->cd(); c1->SetBottomMargin(0.2); //now I'd like to sort the tag outer as a function of the most energetic photon bin for(int i=0; i<4; i++){ xSectagCorrOut[i]=xSectagCorrOut_tmp[i]; errxSectagCorrOut[i]=errxSectagCorrOut_tmp[i]; errSysxSectagCorrOut[i]=errSysxSectagCorrOut_tmp[i]; xSectagCorrOut[i+4]=xSectagCorrOut_tmp[i+4]; errxSectagCorrOut[i+4]=errxSectagCorrOut_tmp[i+4]; errSysxSectagCorrOut[i+4]=errSysxSectagCorrOut_tmp[i+4]; } auto grxSecTagIn= new TGraphErrors(8); grxSecTagIn->SetMarkerColor(kOrange+7); grxSecTagIn->SetMarkerStyle(22); grxSecTagIn->SetMarkerSize(0.7); auto grxSecTagOut= new TGraphErrors(8); grxSecTagOut->SetMarkerColor(kCyan+2); grxSecTagOut->SetMarkerStyle(23); grxSecTagOut->SetMarkerSize(0.7); auto grxSecPhi= new TGraphErrors(8); grxSecPhi->SetMarkerColor(kMagenta-5); grxSecPhi->SetMarkerStyle(21); grxSecPhi->SetMarkerSize(0.7); auto grxSecTagInSys = new TGraphErrors(8);// AnOp,r1_EffApOp , AnOpErr , AnOpErr, r1_errSysInfEffApOp ,r1_errSysSupEffApOp ); grxSecTagInSys->SetMarkerColor(kOrange+7); grxSecTagInSys->SetMarkerStyle(22); grxSecTagInSys->SetMarkerSize(0.7); grxSecTagInSys->SetFillColorAlpha(kOrange-9,0.4); //grxSecTagInSys->SetFillStyle(3001); auto grxSecTagOutSys = new TGraphErrors(8);// AnOp,r1_EffApOp , AnOpErr , AnOpErr, r1_errSysInfEffApOp ,r1_errSysSupEffApOp ); grxSecTagOutSys->SetMarkerColor(kCyan+2); grxSecTagOutSys->SetMarkerStyle(23); grxSecTagOutSys->SetMarkerSize(0.7); grxSecTagOutSys->SetFillColorAlpha(kCyan-9,0.4); //grxSecTagOutSys->SetFillStyle(3001); auto grxSecPhiSys = new TGraphErrors(8);// AnOp,r1_EffApOp , AnOpErr , AnOpErr, r1_errSysInfEffApOp ,r1_errSysSupEffApOp ); grxSecPhiSys->SetMarkerColor(kMagenta-5); grxSecPhiSys->SetMarkerStyle(21); grxSecPhiSys->SetMarkerSize(0.7); grxSecPhiSys->SetFillColorAlpha(kMagenta-10,0.4); //grxSecPhiSys->SetFillStyle(3001); auto grxSecBabaYaga = new TGraphErrors(8);// AnOp,r1_EffApOp , AnOpErr , AnOpErr, r1_errSysInfEffApOp ,r1_errSysSupEffApOp ); grxSecBabaYaga->SetMarkerStyle(9); grxSecBabaYaga->SetMarkerSize(0.7); grxSecBabaYaga->SetFillColorAlpha(kYellow-9,0.5); auto grxSecBabaYaga2 = new TGraphErrors(8);// AnOp,r1_EffApOp , AnOpErr , AnOpErr, r1_errSysInfEffApOp ,r1_errSysSupEffApOp ); grxSecBabaYaga2->SetMarkerStyle(9); grxSecBabaYaga2->SetMarkerSize(0.7); grxSecBabaYaga2->SetFillColorAlpha(kYellow-6,0.5); for (Int_t i = 0; i < 8; i++) { grxSecTagIn->SetPoint(i, i + 1.08, xSectagCorrIn[i]); grxSecTagIn->SetPointError(i, 0 , errxSectagCorrIn[i]); grxSecTagInSys->SetPoint(i, i + 1.08, xSectagCorrIn[i]); grxSecTagInSys->SetPointError( i, 0, errSysxSectagCorrIn[i]); grxSecTagOut->SetPoint(i, i + 0.92, xSectagCorrOut[i]); grxSecTagOut->SetPointError(i, 0 , errxSectagCorrOut[i]); grxSecTagOutSys->SetPoint(i, i + 0.92, xSectagCorrOut[i]); grxSecTagOutSys->SetPointError( i, 0, errSysxSectagCorrOut[i]); grxSecPhi->SetPoint(i, i + 1., xSecdPhiCorr[i]); grxSecPhi->SetPointError(i, 0 , errxSecdPhiCorr[i]); grxSecPhiSys->SetPoint(i, i + 1., xSecdPhiCorr[i]); grxSecPhiSys->SetPointError( i, 0, errSysxSecdPhiCorr[i]); Double_t xsec=1.957275; Double_t errxsec=0.04*1.957275; grxSecBabaYaga->SetPoint(i, i + 1., xsec); grxSecBabaYaga->SetPointError( i, 0, errxsec); Double_t errxsec2=0.04*1.957275+0.02; grxSecBabaYaga2->SetPoint(i, i + 1., xsec); grxSecBabaYaga2->SetPointError( i, 0, errxsec2); } TMultiGraph *mg = new TMultiGraph(); mg->Add(grxSecTagInSys,"3p"); mg->Add(grxSecTagOutSys,"3p"); mg->Add(grxSecPhiSys,"3p"); mg->Add(grxSecBabaYaga2,"3p"); mg->Add(grxSecBabaYaga,"3p"); mg->Add(grxSecTagIn,"p"); mg->Add(grxSecTagOut,"p"); mg->Add(grxSecPhi,"p"); mg->Draw("a"); for (Int_t i = 0; i < 8; i++) { mg->GetXaxis()->SetBinLabel(mg->GetXaxis()->FindBin(i + 1.), x_labels[i].c_str()); } mg->GetYaxis()->SetRangeUser(1.5, 2.8); mg->GetYaxis()->SetTitle("#sigma(e^{+}e^{-}#rightarrow #gamma #gamma [mb])"); mg->GetYaxis()->SetTitle("#sigma(e^{+}e^{-} #rightarrow #gamma #gamma) [mb]"); PADME_LABEL(0.2,0.87); myText( 0.35,0.87,1,"Preliminary"); myText( 0.2,0.82,1,"Cross section trend"); myText( 0.2,0.78,1,"nominal bunch #Delta t 280 ns",0.038); myText( 0.2,0.73,1,"EBeam = 430 MeV", 0.038); //myText( 0.2,0.68,1,"e^{+} e^{-} #rightarrow #gamma #gamma", 0.038); TLine *line = new TLine(c1->GetUxmin(),1.957275,c1->GetUxmax(),1.957275); // xmin , ymin, xmax, ymax line->SetLineStyle(8); line->SetLineColor(kGray+1); line->SetLineWidth(2); line->Draw("SAME"); auto leg = new TLegend(0.55,0.7,0.9,0.9); leg->AddEntry(grxSecTagInSys, "1 #gamma (tag) inner ring", "lepf"); leg->AddEntry(grxSecTagOutSys, "1 #gamma (tag) outer ring", "lepf"); leg->AddEntry(grxSecPhiSys, "2 #gamma", "lepf"); leg->SetTextAlign(12); leg->SetBorderSize(0); leg->SetFillStyle(0); leg->SetFillColor(0); leg->SetTextFont(43); leg->SetTextSize(15); leg->Draw(); c1->SaveAs("~/html/allow_listing/PhDThesisImage/png/DataxSec_clQnPOTselectionRunTrend2.png"); c1->SaveAs("../../CPlot/DataxSec_clQnPOTselectionRunTrend2.C"); return; } void makeTrendMoriond(){ std::string x_labels[7]={"30369","30386","30547","30553","30563","30617","30624"}; std::string y_labelsA[6]={"Average", "#Delta #phi", "#Delta E_{in}", "M_{miss, in}^{2}", "#Delta E_{out}", "M_{miss, out}^{2}" }; Double_t nPOT[8]={81649724575.8, 27808076763.4,71341183911.7,28050480995.8,60224227759.5,61251354096.8,66320622918.5, 396645671021.1}; //new one Double_t feffIn[8]={0.736, 0.790, 0.739, 0.72 , 0.728, 0.740, 0.719 , 0.731}; Double_t feffOut[8]={0.703, 0.741, 0.737 , 0.69 , 0.718, 0.721, 0.696, 0.714}; Double_t ferreffIn[8]={ 0.018,0.014, 0.011,0.057,0.046,0.058,0.035,0.009}; Double_t ferreffOut[8]={0.011, 0.028, 0.02 ,0.024,0.018,0.023,0.016,0.006}; //new one Double_t fTagSortedIn[8]={74918 , 27854 , 67095 , 26343 , 56505 , 57951 , 63696 , 375623}; Double_t ferrTagSortedIn[8]={1105.7, 1038.3 , 1839 , 876.5 , 1356.2, 1829.5, 1425.2, 2951.4}; Double_t fTagSortedOut[8]={71134 , 26007 , 66487 , 25134 , 55459 , 56665 , 61268 , 365663}; Double_t ferrTagSortedOut[8]={1678.2,436.6, 928 , 1965.8, 3492.5, 4407.5, 3004.7 , 4252.1}; Double_t fdPhi[8]={54567 , 21442 , 51473 , 19039 , 42205 , 43316 , 45697 , 276704}; Double_t ferrdPhi[8]={ 234, 146, 227, 138, 205, 208, 214, 526}; Double_t fevEff[8]={0.517, 0.585, 0.545, 0.497 , 0.523, 0.534, 0.5, 0.522}; Double_t ferrevEff[8]={0.015, 0.024,0.017,0.043,0.036,0.045,0.027,0.008}; //Double_t Const=0.0634125*0.0105; Double_t Const=0.0642453*0.0105; Double_t tagCorrIn[8]={0.}; Double_t errtagCorrIn[8]={0.}; Double_t tagCorrOut[8]={0.}; Double_t errtagCorrOut[8]={0.}; Double_t xSectagCorrIn[7]={0.}; Double_t errxSectagCorrIn[7]={0.}; Double_t errSysxSectagCorrIn[7]={0.}; Double_t xSectagCorrOut_tmp[8]={0.}; Double_t errxSectagCorrOut_tmp[8]={0.}; Double_t errSysxSectagCorrOut_tmp[8]={0.}; Double_t xSectagCorrOut[7]={0.}; Double_t errxSectagCorrOut[7]={0.}; Double_t errSysxSectagCorrOut[7]={0.}; Double_t dPhiCorr[8]={0.}; Double_t errdPhiCorr[8]={0.}; Double_t xSecdPhiCorr[7]={0.}; Double_t errxSecdPhiCorr[7]={0.}; Double_t errSysxSecdPhiCorr[7]={0.}; Double_t DPhi_wmean2=0.; Double_t DPhi_wmean=0.; Double_t DPhi_err2=0.; Double_t DPhi_norm=0.; Double_t DPhi_werrmean=0.; Double_t DPhi_errnorm=0.; Double_t TagIn_wmean2=0.; Double_t TagIn_wmean=0.; Double_t TagIn_err2=0.; Double_t TagIn_norm=0.; Double_t TagIn_werrmean=0.; Double_t TagIn_errnorm=0.; Double_t TagOut_wmean2=0.; Double_t TagOut_wmean=0.; Double_t TagOut_err2=0.; Double_t TagOut_norm=0.; Double_t xSecCorrA[5]={0.}; Double_t errxSecCorrA[5]={0.}; Double_t errSysxSecCorrA[5]={0.}; xSecCorrA[2]=1.889; errxSecCorrA[2]=0.024; errSysxSecCorrA[2]=0.024; xSecCorrA[4]=1.968; errxSecCorrA[4]=0.048; errSysxSecCorrA[4]=0.048; Double_t NggWMean_DPhi =1.98167 ;// 1.99986; Double_t NggWMean_tagIn = 1.90825; //1.92711; Double_t NggWMean_tagOut=1.89756; // 1.91892; Double_t DPhiTagIn_wmean2=0.; Double_t DPhiTagIn_wmean=0.; Double_t DPhiTagIn_err2=0.; Double_t DPhiTagIn_norm=0.; Double_t NggWMean_DPhiTagIn = -0.0555001; TH1F* hDPhi = new TH1F("hDPhi", "hDPhi", 50, 1.70, 2.4); TH1F* hTagIn = new TH1F("hTagIn", "hTagIn", 50, 1.70, 2.4); TH1F* hTagOut = new TH1F("hTagOut", "hTagOut", 50, 1.70, 2.4); TH1F* hDPhiTagIn = new TH1F("hDPhiTagIn", "hDPhiTagIn", 100, -1, 1); for(int i=0; i<8; i++){ Double_t norm= nPOT[i]*Const; tagCorrIn[i]=fTagSortedIn[i]/feffIn[i]; //errtagCorrIn[i]=sqrt((1/feffIn[i]/feffIn[i])*(1/feffIn[i]/feffIn[i])*ferrTagSortedIn[i]*ferrTagSortedIn[i] + (fTagSortedIn[i]/feffIn[i]/feffIn[i])*(fTagSortedIn[i]/feffIn[i]/feffIn[i] )*ferreffIn[i]*ferreffIn[i]); errtagCorrIn[i]=sqrt((1/feffIn[i]/feffIn[i])*ferrTagSortedIn[i]*ferrTagSortedIn[i] + (fTagSortedIn[i]/feffIn[i]/feffIn[i])*(fTagSortedIn[i]/feffIn[i]/feffIn[i] )*ferreffIn[i]*ferreffIn[i]); if(i<7){ xSectagCorrIn[i]=tagCorrIn[i]/norm*1000; errxSectagCorrIn[i]= errtagCorrIn[i]/norm*1000; errSysxSectagCorrIn[i]=errxSectagCorrIn[i]; } else{ xSecCorrA[1]=tagCorrIn[i]/norm*1000; errxSecCorrA[1]= errtagCorrIn[i]/norm*1000; errSysxSecCorrA[1]=errxSecCorrA[1]; } //errSysxSectagCorrIn[i]=sqrt((0.05*xSectagCorrIn[i])*(0.05*xSectagCorrIn[i])+errxSectagCorrIn[i]*errxSectagCorrIn[i]); if(i<7){ TagIn_wmean2=TagIn_wmean2+ (xSectagCorrIn[i]-NggWMean_tagIn)*(xSectagCorrIn[i]-NggWMean_tagIn)/errxSectagCorrIn[i]/errxSectagCorrIn[i]; TagIn_wmean=TagIn_wmean+ xSectagCorrIn[i]/errxSectagCorrIn[i]/errxSectagCorrIn[i]; //*nPOT[i]; TagIn_err2+=1/errxSectagCorrIn[i]/errxSectagCorrIn[i]; TagIn_norm+=1/errxSectagCorrIn[i]/errxSectagCorrIn[i];//nPOT[i]; hTagIn->Fill(xSectagCorrIn[i], errxSectagCorrIn[i]*nPOT[i] ); TagIn_werrmean=TagIn_werrmean+ xSectagCorrIn[i]*errxSectagCorrIn[i]; TagIn_errnorm+=errxSectagCorrIn[i]; } tagCorrOut[i]=fTagSortedOut[i]/feffOut[i]; //errtagCorrOut[i]=sqrt((1/feffOut[i]/feffOut[i])*(1/feffOut[i]/feffOut[i])*ferrTagSortedOut[i]*ferrTagSortedOut[i] + (fTagSortedOut[i]/feffOut[i]/feffOut[i])*(fTagSortedOut[i]/feffOut[i]/feffOut[i] )*ferreffOut[i]*ferreffOut[i]); errtagCorrOut[i]=sqrt((1/feffOut[i]/feffOut[i])*ferrTagSortedOut[i]*ferrTagSortedOut[i] + (fTagSortedOut[i]/feffOut[i]/feffOut[i])*(fTagSortedOut[i]/feffOut[i]/feffOut[i] )*ferreffOut[i]*ferreffOut[i]); xSectagCorrOut_tmp[i]=tagCorrOut[i]/norm*1000; errxSectagCorrOut_tmp[i]= errtagCorrOut[i]/norm*1000; errSysxSectagCorrOut_tmp[i]=errxSectagCorrOut_tmp[i]; if(i<7){ TagOut_wmean2=TagOut_wmean2+ (xSectagCorrOut_tmp[i]-NggWMean_tagOut)*(xSectagCorrOut_tmp[i]-NggWMean_tagOut)/errxSectagCorrOut_tmp[i]/errxSectagCorrOut_tmp[i]; TagOut_wmean=TagOut_wmean+ xSectagCorrOut_tmp[i]/errxSectagCorrOut_tmp[i]/errxSectagCorrOut_tmp[i]; //*nPOT[i]; TagOut_err2+=1/errxSectagCorrOut_tmp[i]/errxSectagCorrOut_tmp[i]; TagOut_norm+=1/errxSectagCorrOut_tmp[i]/errxSectagCorrOut_tmp[i]; //nPOT[i]; hTagOut->Fill(xSectagCorrOut_tmp[i],errxSectagCorrOut_tmp[i]*nPOT[i] ); } dPhiCorr[i]=fdPhi[i]/fevEff[i]; //errdPhiCorr[i]=sqrt((1/fevEff[i]/fevEff[i])*(1/fevEff[i]/fevEff[i])*ferrdPhi[i]*ferrdPhi[i] + (fdPhi[i]/fevEff[i]/fevEff[i])*(fdPhi[i]/fevEff[i]/fevEff[i] )*ferrevEff[i]*ferrevEff[i]); errdPhiCorr[i]=sqrt((1/fevEff[i]/fevEff[i])*ferrdPhi[i]*ferrdPhi[i] + (fdPhi[i]/fevEff[i]/fevEff[i])*(fdPhi[i]/fevEff[i]/fevEff[i] )*ferrevEff[i]*ferrevEff[i]); if(i<7){ xSecdPhiCorr[i]=dPhiCorr[i]/norm*1000; errxSecdPhiCorr[i]=errdPhiCorr[i]/norm*1000; errSysxSecdPhiCorr[i]=errxSecdPhiCorr[i]; } else{ xSecCorrA[0]=dPhiCorr[i]/norm*1000; errxSecCorrA[0]=errdPhiCorr[i]/norm*1000; errSysxSecCorrA[0]=errxSecCorrA[0]; } if(i<7){ DPhi_wmean2=DPhi_wmean2+ (xSecdPhiCorr[i]-NggWMean_DPhi)*(xSecdPhiCorr[i]-NggWMean_DPhi)/errxSecdPhiCorr[i]/errxSecdPhiCorr[i]; DPhi_wmean=DPhi_wmean+ xSecdPhiCorr[i]/errxSecdPhiCorr[i]/errxSecdPhiCorr[i]; //*nPOT[i]; DPhi_err2+=1/errxSecdPhiCorr[i]/errxSecdPhiCorr[i]; DPhi_norm+=1/errxSecdPhiCorr[i]/errxSecdPhiCorr[i]; //nPOT[i]; DPhi_werrmean=DPhi_werrmean+ xSecdPhiCorr[i]*errxSecdPhiCorr[i]; DPhi_errnorm+=errxSecdPhiCorr[i]; hDPhi->Fill(xSecdPhiCorr[i],errxSecdPhiCorr[i]*nPOT[i] ); Double_t diff=xSectagCorrIn[i]- xSecdPhiCorr[i]; Double_t errdiff = sqrt(errxSectagCorrIn[i]*errxSectagCorrIn[i]+ errxSecdPhiCorr[i]*errxSecdPhiCorr[i]); DPhiTagIn_wmean+=DPhiTagIn_wmean+ diff*(fdPhi[i]+fTagSortedIn[i]); DPhiTagIn_norm+= (fdPhi[i]+fTagSortedIn[i]); DPhiTagIn_wmean2+=DPhiTagIn_wmean2+ (diff-NggWMean_DPhiTagIn)*(diff-NggWMean_DPhiTagIn)*errdiff*errdiff; DPhiTagIn_err2+=errdiff*errdiff; hDPhiTagIn->Fill(diff, errdiff*nPOT[i]); } } std::cout<<"meanWerr DPhi " << (DPhi_werrmean/DPhi_errnorm) << " tagIn " << (TagIn_werrmean/TagIn_errnorm) << " diff " << (DPhi_werrmean/DPhi_errnorm - TagIn_werrmean/TagIn_errnorm) << std::endl; //TCanvas *c2 = new TCanvas("c2", "c2", 1200,600); //c2->Divide(2,2); //c2->cd(1); //hDPhi->Draw(); //c2->cd(2); //hTagIn->Draw(); //c2->cd(3); //hTagOut->Draw(); //c2->cd(4); //hDPhiTagIn->Draw(); std::cout<<" NggWMean - DPhi "<< DPhi_wmean/DPhi_norm << " tagIn " << TagIn_wmean/ TagIn_norm << " tagOut " << TagOut_wmean/ TagOut_norm << std::endl; Double_t DPhiTagIn_RMS=sqrt(DPhiTagIn_wmean2/DPhiTagIn_err2); // std::cout<<"DPhiTagIn xSec difference "<< DPhiTagIn_wmean/ DPhiTagIn_norm << " RMS " << DPhiTagIn_RMS << std::endl; Double_t DPhi_RMS=sqrt(DPhi_wmean2/DPhi_err2); Double_t TagIn_RMS =sqrt(TagIn_wmean2/ TagIn_err2); Double_t TagOut_RMS=sqrt(TagOut_wmean2/TagOut_err2); std::cout<<"WRMS - DPhi " << DPhi_RMS << " tagIn " << TagIn_RMS << " tagOut " << TagOut_RMS << std::endl; std::cout<<"RMS from plot- DPhi " << hDPhi->GetRMS() << " tagIn " << hTagIn->GetRMS() << " tagOut " << hTagOut->GetRMS() << std::endl; //return; TCanvas *c1 = new TCanvas("c1", "c1", 700,500); c1->cd(); c1->SetBottomMargin(0.2); //now I'd like to sort the tag outer as a function of the most energetic photon bin for(int i=0; i<7; i++){ xSectagCorrOut[i]=xSectagCorrOut_tmp[i]; errxSectagCorrOut[i]=errxSectagCorrOut_tmp[i]; errSysxSectagCorrOut[i]=errSysxSectagCorrOut_tmp[i]; } xSecCorrA[3]=xSectagCorrOut_tmp[7]; errxSecCorrA[3]=errxSectagCorrOut_tmp[7]; errSysxSecCorrA[3]=errSysxSectagCorrOut_tmp[7]; auto grxSecTagIn= new TGraphErrors(7); grxSecTagIn->SetMarkerColor(kOrange+7); grxSecTagIn->SetMarkerStyle(22); grxSecTagIn->SetMarkerSize(0.7); auto grxSecTagOut= new TGraphErrors(7); grxSecTagOut->SetMarkerColor(kCyan+2); grxSecTagOut->SetMarkerStyle(23); grxSecTagOut->SetMarkerSize(0.7); auto grxSecPhi= new TGraphErrors(7); grxSecPhi->SetMarkerColor(kMagenta-5); grxSecPhi->SetMarkerStyle(21); grxSecPhi->SetMarkerSize(0.7); auto grxSecTagInSys = new TGraphErrors(7);// AnOp,r1_EffApOp , AnOpErr , AnOpErr, r1_errSysInfEffApOp ,r1_errSysSupEffApOp ); grxSecTagInSys->SetMarkerColor(kOrange+7); grxSecTagInSys->SetMarkerStyle(22); grxSecTagInSys->SetMarkerSize(0.7); grxSecTagInSys->SetFillColorAlpha(kOrange-9,0.4); //grxSecTagInSys->SetFillStyle(3001); auto grxSecTagOutSys = new TGraphErrors(7);// AnOp,r1_EffApOp , AnOpErr , AnOpErr, r1_errSysInfEffApOp ,r1_errSysSupEffApOp ); grxSecTagOutSys->SetMarkerColor(kCyan+2); grxSecTagOutSys->SetMarkerStyle(23); grxSecTagOutSys->SetMarkerSize(0.7); grxSecTagOutSys->SetFillColorAlpha(kCyan-9,0.4); //grxSecTagOutSys->SetFillStyle(3001); auto grxSecPhiSys = new TGraphErrors(7);// AnOp,r1_EffApOp , AnOpErr , AnOpErr, r1_errSysInfEffApOp ,r1_errSysSupEffApOp ); grxSecPhiSys->SetMarkerColor(kMagenta-5); grxSecPhiSys->SetMarkerStyle(21); grxSecPhiSys->SetMarkerSize(0.7); grxSecPhiSys->SetFillColorAlpha(kMagenta-10,0.4); //grxSecPhiSys->SetFillStyle(3001); auto grxSecBabaYaga = new TGraphErrors(7);// AnOp,r1_EffApOp , AnOpErr , AnOpErr, r1_errSysInfEffApOp ,r1_errSysSupEffApOp ); grxSecBabaYaga->SetMarkerStyle(9); grxSecBabaYaga->SetMarkerSize(0.7); grxSecBabaYaga->SetFillColorAlpha(kYellow-9,0.5); auto grxSecBabaYaga2 = new TGraphErrors(7);// AnOp,r1_EffApOp , AnOpErr , AnOpErr, r1_errSysInfEffApOp ,r1_errSysSupEffApOp ); grxSecBabaYaga2->SetMarkerStyle(9); grxSecBabaYaga2->SetMarkerSize(0.7); grxSecBabaYaga2->SetFillColorAlpha(kYellow-6,0.5); for (Int_t i = 0; i < 7; i++) { grxSecTagIn->SetPoint(i, i + 1.08, xSectagCorrIn[i]); grxSecTagIn->SetPointError(i, 0 , errxSectagCorrIn[i]); grxSecTagInSys->SetPoint(i, i + 1.08, xSectagCorrIn[i]); grxSecTagInSys->SetPointError( i, 0, errSysxSectagCorrIn[i]); grxSecTagOut->SetPoint(i, i + 0.92, xSectagCorrOut[i]); grxSecTagOut->SetPointError(i, 0 , errxSectagCorrOut[i]); grxSecTagOutSys->SetPoint(i, i + 0.92, xSectagCorrOut[i]); grxSecTagOutSys->SetPointError( i, 0, errSysxSectagCorrOut[i]); grxSecPhi->SetPoint(i, i + 1., xSecdPhiCorr[i]); grxSecPhi->SetPointError(i, 0 , errxSecdPhiCorr[i]); grxSecPhiSys->SetPoint(i, i + 1., xSecdPhiCorr[i]); grxSecPhiSys->SetPointError( i, 0, errSysxSecdPhiCorr[i]); Double_t xsec=1.957275; Double_t errxsec=0.04*1.957275; grxSecBabaYaga->SetPoint(i, i + 1., xsec); grxSecBabaYaga->SetPointError( i, 0, errxsec); Double_t errxsec2=0.04*1.957275+0.02; grxSecBabaYaga2->SetPoint(i, i + 1., xsec); grxSecBabaYaga2->SetPointError( i, 0, errxsec2); } TMultiGraph *mg = new TMultiGraph(); mg->Add(grxSecTagInSys,"3p"); mg->Add(grxSecTagOutSys,"3p"); mg->Add(grxSecPhiSys,"3p"); mg->Add(grxSecBabaYaga2,"3p"); mg->Add(grxSecBabaYaga,"3p"); mg->Add(grxSecTagIn,"p"); mg->Add(grxSecTagOut,"p"); mg->Add(grxSecPhi,"p"); mg->Draw("a"); for (Int_t i = 0; i < 7; i++) { mg->GetXaxis()->SetBinLabel(mg->GetXaxis()->FindBin(i + 1.), x_labels[i].c_str()); } mg->GetYaxis()->SetRangeUser(1.5, 2.8); mg->GetYaxis()->SetTitle("#sigma(e^{+}e^{-}#rightarrow #gamma #gamma [mb])"); mg->GetYaxis()->SetTitle("#sigma(e^{+}e^{-} #rightarrow #gamma #gamma) [mb]"); PADME_LABEL(0.2,0.87); myText( 0.35,0.87,1,"Preliminary"); myText( 0.2,0.82,1,"Cross section trend"); myText( 0.2,0.78,1,"nominal bunch #Delta t 280 ns",0.038); myText( 0.2,0.73,1,"EBeam = 430 MeV", 0.038); //myText( 0.2,0.68,1,"e^{+} e^{-} #rightarrow #gamma #gamma", 0.038); TLine *line = new TLine(c1->GetUxmin(),1.957275,c1->GetUxmax(),1.957275); // xmin , ymin, xmax, ymax line->SetLineStyle(8); line->SetLineColor(kGray+1); line->SetLineWidth(2); line->Draw("SAME"); auto leg = new TLegend(0.55,0.7,0.9,0.9); leg->AddEntry(grxSecTagInSys, "1 #gamma (tag) inner ring", "lepf"); leg->AddEntry(grxSecTagOutSys, "1 #gamma (tag) outer ring", "lepf"); leg->AddEntry(grxSecPhiSys, "2 #gamma", "lepf"); leg->SetTextAlign(12); leg->SetBorderSize(0); leg->SetFillStyle(0); leg->SetFillColor(0); leg->SetTextFont(43); leg->SetTextSize(15); leg->Draw(); c1->SaveAs("~/html/allow_listing/PhDThesisImage/png/DataxSec_clQnPOTselectionRunTrendMoriond.png"); c1->SaveAs("../../CPlot/DataxSec_clQnPOTselectionRunTrendMoriond.C"); TCanvas *c2 = new TCanvas("c2", "c2", 700,500); c2->cd(); c2->SetBottomMargin(0.2); auto grxSec= new TGraphErrors(5); //grxSec->SetMarkerColor(kOrange+7); grxSec->SetMarkerStyle(8); //grxSec->SetMarkerSize(0.7); auto grxSecBabaYaga2n = new TGraphErrors(6);// AnOp,r1_EffApOp , AnOpErr , AnOpErr, r1_errSysInfEffApOp ,r1_errSysSupEffApOp ); grxSecBabaYaga2n->SetMarkerStyle(9); grxSecBabaYaga2n->SetMarkerSize(0.7); //grxSecBabaYaga2n->SetFillColorAlpha(kYellow-9,0.5); grxSecBabaYaga2n->SetFillColor(kYellow); auto grxSecBabaYaga22 = new TGraphErrors(6);// AnOp,r1_EffApOp , AnOpErr , AnOpErr, r1_errSysInfEffApOp ,r1_errSysSupEffApOp ); grxSecBabaYaga22->SetMarkerStyle(9); grxSecBabaYaga22->SetMarkerSize(0.7); //grxSecBabaYaga22->SetFillColorAlpha(kYellow-6,0.5); grxSecBabaYaga22->SetFillColor(kOrange); for (Int_t i = 0; i < 6; i++) { if (i<5){ grxSec->SetPoint(i,i +2, xSecCorrA[i]); grxSec->SetPointError(i, 0, errxSecCorrA[i]); std::cout<<"xSec tot " << xSecCorrA[i] <<" error "<SetPoint(i,i+1, xSecCorrA[i]); grxSecSys->SetPointError( i, 0, errSysxSecCorrA[i]); */ Double_t xsec=1.957275; Double_t errxsec=0.04*1.957275; if (i==0) { grxSecBabaYaga2n->SetPoint(i, i+1-0.5,xsec ); grxSecBabaYaga2n->SetPointError( i, 0,errxsec); } else if (i==5) { grxSecBabaYaga2n->SetPoint(i, i+1+0.5,xsec ); grxSecBabaYaga2n->SetPointError( i, 0,errxsec); } else { grxSecBabaYaga2n->SetPoint(i, i+1,xsec ); grxSecBabaYaga2n->SetPointError( i, 0,errxsec); } Double_t errxsec2=sqrt(0.04*0.04*1.957275*1.957275+0.02*0.02); if (i==0) { grxSecBabaYaga22->SetPoint(i, i+1-0.5,xsec ); grxSecBabaYaga22->SetPointError( i, 0,errxsec2); } else if (i==5) { grxSecBabaYaga22->SetPoint(i, i+1+0.5,xsec ); grxSecBabaYaga22->SetPointError( i, 0,errxsec2); } else { grxSecBabaYaga22->SetPoint(i, i+1,xsec ); grxSecBabaYaga22->SetPointError( i, 0,errxsec2); } } TGraphErrors* grxSecAve = (TGraphErrors*)grxSec->Clone();//new TGraphErrors(*grxSec); grxSecAve->RemovePoint(4); grxSecAve->RemovePoint(3); grxSecAve->SetMarkerSize(1.3); grxSecAve->SetLineWidth(2); grxSec->SetMarkerStyle(23); grxSec->SetMarkerSize(1.); grxSec->SetMarkerColor(kBlue); grxSec->SetLineColor(kBlue); auto average = new TGraphErrors(1); average->SetPoint(0, 1, 1.930); average->SetPointError(0, 0.05, 0.029); auto averageSys = new TGraphErrors(1); averageSys->SetPoint(0, 1, 1.930); averageSys->SetPointError(0, 0.05, sqrt(0.029*0.029+0.057*0.057)); average->SetLineWidth(5); average->SetMarkerSize(1.5); averageSys->SetLineColor(2); averageSys->SetLineWidth(5); averageSys->SetFillColor(kBlue); average->SetFillColor(kCyan); TMultiGraph *mg2 = new TMultiGraph(); //mg2->Add(grxSecSys,"3p"); mg2->Add(grxSecBabaYaga22,"3p"); mg2->Add(grxSecBabaYaga2n,"3p"); mg2->Add(grxSec,"p"); mg2->Add(grxSecAve,"p"); mg2->Add(averageSys,"2p"); mg2->Add(average, "2p"); mg2->Draw("A"); for (Int_t i = 0; i < 6; i++) { mg2->GetXaxis()->SetBinLabel(mg2->GetXaxis()->FindBin(i +1), y_labelsA[i].c_str()); //mg2->GetXaxis()->ChangeLabel(mg2->GetXaxis()->FindBin(i +1), 30); if (i!=0) mg2->GetXaxis()->ChangeLabel(mg2->GetXaxis()->FindBin(i +1), 30, 0.05, 23); else mg2->GetXaxis()->ChangeLabel(mg2->GetXaxis()->FindBin(i +1), 0, 0.05, 23); } //mg2->GetXaxis()->ChangeLabel(-1, 30); /* mg2->GetXaxis()->ChangeLabel(6, 30); mg2->GetXaxis()->ChangeLabel(7, 30); mg2->GetXaxis()->ChangeLabel(8, 30); mg2->GetXaxis()->ChangeLabel(9, 30); */ mg2->GetYaxis()->SetRangeUser(1.80, 2.15); mg2->GetYaxis()->SetTitle("#sigma(e^{+}e^{-}#rightarrow #gamma #gamma) [mb]"); mg2->GetYaxis()->CenterTitle(); mg2->GetXaxis()->SetLabelOffset(0.01); std::cout<<" offset = "<GetXaxis()->GetLabelOffset()<GetUxmin(),1.957275, c2->GetUxmax(),1.957275); // xmin , ymin, xmax, ymax linen->SetLineStyle(8); linen->SetLineColor(kGray+1); linen->SetLineWidth(2); linen->Draw("SAME"); //auto leg2 = new TLegend(0.55,0.7,0.9,0.9); //leg2->AddEntry(grxSecSys, "1 #gamma (tag) inner ring", "lepf"); //leg2->AddEntry(grxSecTagOutSys2, "1 #gamma (tag) outer ring", "lepf"); // //leg2->SetTextAlign(12); //leg2->SetBorderSize(0); //leg2->SetFillStyle(0); //leg2->SetFillColor(0); //leg2->SetTextFont(43); //leg2->SetTextSize(15); //leg2->Draw(); c2->SaveAs("~/html/allow_listing/PhDThesisImage/png/DataxSec_AllclQnPOTselectionRunTrendMoriond.png"); c2->SaveAs("~/myAfsLinks/ssLecce/html/allow_listing/pp/DataxSec_AllclQnPOTselectionRunTrendMoriond.pdf"); return; }