void align() { gROOT->SetStyle("Plain"); TCanvas *c1=new TCanvas("c1","c1",900,800); TFile *file=TFile::Open("align.root"); gStyle->SetOptStat(0); c1->Divide(3,4); double dx,dy,da; TH1F *ha; TGraphErrors *ta; double cAvg[4][3]={{-0.051,-0.252,-0.0101}, { 0.606,-0.225,-0.0007}, { 0.509,-0.110,-0.0076}, { 0.225,-0.307,-0.0106}}; double cDel[3]={0.002,0.002,0.0002}; string lSt[4]={"L1","L3","L4","L5"}; string cSt[3]={"X","Y","A"}; for(unsigned l=0;l<4;l++) { for(unsigned c=0;c<3;c++) { string hName=lSt[l]+"Align"+cSt[c]; ha=(TH1F*)file->Get(hName.c_str()); string tName=lSt[l]+"Delta"+cSt[c]; ta=(TGraphErrors*)file->Get(tName.c_str()); // Cludge for run 20000 ha->SetBinContent(1,ha->GetBinContent(2)); c1->cd(3*l+c+1); ha->GetXaxis()->SetRange(0,71); ha->GetYaxis()->SetRangeUser(cAvg[l][c]-cDel[c],cAvg[l][c]+cDel[c]); ha->SetLineColor(2); ha->Draw(); ta->SetMarkerStyle(20); ta->SetMarkerSize(0.5); ta->Draw("P same"); } } c1->Print("../alignment.png"); }