void ThetaRes(TString path = "/panda/myResults/G4_ph_lists/BOX_2_12mrad_G4_FTF_BERT_"){ // const int npmom=5; // double Pbeam[npmom]={1.5,4.06,8.9,11.91,15}; // TString Pbeam_str[npmom] = {"/mom_1_5/","/mom_4_06/","/mom_8_9/","/mom_11_91/","/mom_15/"}; const int npmom=1; double Pbeam[npmom]={1.5}; TString Pbeam_str[npmom] = {"/mom_1_5/"}; TString path_noCut = path+"noCut/"; TString path_BoxCut = path+"BoxCut/"; TString path_XYCut = path+"XYCut/"; const int nmethods=3; TH1 *hth_mean[nmethods]; TH1 *hth_rms[nmethods]; for(int qb=0;qbIsZombie()) cout<<"File: "<Get("NearIP/hResTheta_th"); TH2D *hth_th0 = (TH2D*)fin_noCut->Get("NearIP/hResTheta_ph"); hth_th0->FitSlicesY(); hth_mean[imeth] = (TH1D*)gDirectory->Get("hResTheta_ph_1"); hth_rms[imeth] = (TH1D*)gDirectory->Get("hResTheta_ph_2"); hth_mean[imeth]->SetMarkerStyle(20); hth_rms[imeth]->SetMarkerStyle(20); hth_mean[imeth]->GetYaxis()->SetTitle("mean(#theta_{MC}-#theta_{REC}), mrad"); hth_mean[imeth]->SetMarkerColor(2); hth_rms[imeth]->SetMarkerColor(2); hth_rms[imeth]->GetYaxis()->SetTitle("sigma(#theta_{MC}-#theta_{REC}), mrad"); hth_mean[imeth]->SetMarkerSize(2.5); hth_rms[imeth]->SetMarkerSize(2.5); imeth++; TString fname_BoxCut = path_BoxCut; fname_BoxCut+=Pbeam_str[qb]; fname_BoxCut +="/Lumi_QA_SUM.root"; TFile *fin_BoxCut = new TFile(fname_BoxCut,"READ"); if(fin_BoxCut->IsZombie()) cout<<"File: "<Get("NearIP/hResTheta_ph"); hth_th1->FitSlicesY(); hth_mean[imeth] = (TH1D*)gDirectory->Get("hResTheta_ph_1"); hth_rms[imeth] = (TH1D*)gDirectory->Get("hResTheta_ph_2"); hth_mean[imeth]->SetMarkerStyle(20); hth_rms[imeth]->SetMarkerStyle(20); hth_mean[imeth]->SetMarkerColor(37); hth_rms[imeth]->SetMarkerColor(37); hth_mean[imeth]->SetMarkerSize(2.5); hth_rms[imeth]->SetMarkerSize(2.5); imeth++; TString fname_XYCut = path_XYCut; fname_XYCut+=Pbeam_str[qb]; fname_XYCut +="/Lumi_QA_SUM.root"; TFile *fin_XYCut = new TFile(fname_XYCut,"READ"); if(fin_XYCut->IsZombie()) cout<<"File: "<Get("NearIP/hResTheta_ph"); hth_th2->FitSlicesY(); hth_mean[imeth] = (TH1D*)gDirectory->Get("hResTheta_ph_1"); hth_rms[imeth] = (TH1D*)gDirectory->Get("hResTheta_ph_2"); hth_mean[imeth]->SetMarkerStyle(20); hth_rms[imeth]->SetMarkerStyle(20); hth_mean[imeth]->SetMarkerColor(4); hth_rms[imeth]->SetMarkerColor(4); hth_mean[imeth]->SetMarkerSize(2.5); hth_rms[imeth]->SetMarkerSize(2.5); // imeth++; } // hth_mean[0] ->Draw(); // hth_mean[1] ->Draw("same"); // hth_mean[2] ->Draw("same"); hth_rms[0] ->Draw(); hth_rms[1] ->Draw("same"); hth_rms[2] ->Draw("same"); TLegend *leg2 = new TLegend(0.15,0.84,0.3,0.99); TString momName = " "; // momName +=Pbeam[0]; momName +="1.5"; momName += " GeV/c"; leg2->SetHeader(momName.Data()); leg2->SetTextAlign(12); leg2->SetTextSize(0.03); leg2->SetFillColor(0); leg2->AddEntry(hth_mean[0],"no Cut","pe"); leg2->AddEntry(hth_mean[1],"Box Cut","pe"); leg2->AddEntry(hth_mean[2],"X&Y Cut","pe"); leg2->Draw(); }