{ gStyle->SetOptFit(1); TCanvas* canv = new TCanvas("posdev","position deviation",20,50,950,900); canv->Divide(2,2); canv->cd(1); TFile *_file0 = TFile::Open("C:/calibGenCAL_analysis/gcr/nomSciOps_12files_groundAsym_sum.gcr_asym_hist.root"); TH2S* h2grlrg =(TH2S*)_file0->Get("/posDevSum/7/ASYM_LL/posDevSum_7_ASYM_LL"); TH1D* h1grlrg = h2grlrg->ProjectionY(); TF1* fungrlrg = new TF1("fungrlrg","gaus",-6,6); h1grlrg->Fit("fungrlrg","R"); h1grlrg->SetXTitle("posXtal - posTkr,mm"); h1grlrg->SetTitle("ground calib, LEX1, lyr 7"); h1grlrg->SetFillColor(2); h1grlrg->SetLineColor(2); canv->cd(2); TH2S* h2grsm =(TH2S*)_file0->Get("/posDevSum/7/ASYM_SS/posDevSum_7_ASYM_SS"); TH1D* h1grsm = h2grsm->ProjectionY(); h1grsm->Rebin(4); TF1* fungrsm = new TF1("fungrsm","gaus",-18,18); h1grsm->Fit("fungrsm","R"); h1grsm->SetXTitle("posXtal - posTkr,mm"); h1grsm->SetTitle("ground calib, HEX8, lyr 7"); h1grsm->SetFillColor(2); h1grsm->SetLineColor(2); canv->cd(3); TFile *_file1 = TFile::Open("C:/calibGenCAL_analysis/gcr/nomSciOps_12files_flightAsym_sum.gcr_asym_hist.root"); TH2S* h2fllrg =(TH2S*)_file1->Get("/posDevSum/7/ASYM_LL/posDevSum_7_ASYM_LL"); TH1D* h1fllrg = h2fllrg->ProjectionY(); TF1* funfllrg = new TF1("funfllrg","gaus",-2.8,2.8); h1fllrg->Fit("funfllrg","R"); h1fllrg->SetXTitle("posXtal - posTkr,mm"); h1fllrg->SetTitle("on-orbit calib, LEX1, lyr 7"); h1fllrg->SetFillColor(4); h1fllrg->SetLineColor(4); canv->cd(4); TH2S* h2flsm =(TH2S*)_file1->Get("/posDevSum/7/ASYM_SS/posDevSum_7_ASYM_SS"); TH1D* h1flsm = h2flsm->ProjectionY(); TF1* funflsm = new TF1("funflsm","gaus",-12,12); h1flsm->Rebin(4); h1flsm->Fit("funflsm","R"); h1flsm->SetXTitle("posXtal - posTkr,mm"); h1flsm->SetTitle("on-orbit calib, HEX8, lyr 7"); h1flsm->SetFillColor(4); h1flsm->SetLineColor(4); canv->Print("posdev_lyr7_gr_orb.gif"); }